July 2019
Intermediate to advanced
410 pages
10h 32m
English
Similar to TestUserInterface used in the previous chapter, the TestInventoryContext class will be used to mock the behavior of our repository by implementing the IInventoryContext interface. This class will support the three methods of the interface, as well as supporting two additional methods for retrieving the books that have been added to the collection during the unit test and for retrieving the books that have been updated during the unit test.
To support the TestInventoryContext class, two collections will be used:
private readonly IDictionary<string, Book> _seedDictionary;private readonly IDictionary<string, Book> _books;
The first is used to store the starting collection of the books, while the second is used ...
Read now
Unlock full access