July 2019
Intermediate to advanced
410 pages
10h 32m
English
UpdateQuantityCommandTest contains a test to validate a scenario where a book is updated in an existing collection. The creation of the expected interface and existing collection are shown in the following code (note that the test involves adding 6 to the quantity of an existing book):
const string expectedBookName = "UpdateQuantityUnitTest";var expectedInterface = new Helpers.TestUserInterface( new List<Tuple<string, string>> { new Tuple<string, string>("Enter name:", expectedBookName), new Tuple<string, string>("Enter quantity:", "6") }, new List<string>(), new List<string>());var context = new TestInventoryContext(new Dictionary<string, Book>{ { "Beavers", new Book { Id = 1, Name = "Beavers", Quantity = 3 } }, ...Read now
Unlock full access