July 2019
Intermediate to advanced
410 pages
10h 32m
English
InventoryCommandFactoryTests contains unit tests related to InventoryCommandFactory. Because each test will have a similar pattern of constructing InventoryCommandFactory and its IUserInterface dependency and then running the GetCommand method, a shared method is created that will run when the test initializes:
[TestInitialize]public void Initialize(){ var expectedInterface = new Helpers.TestUserInterface( new List<Tuple<string, string>>(), new List<string>(), new List<string>() ); Factory = new InventoryCommandFactory(expectedInterface);}
The Initialize method constructs a stubbed IUserInterface and sets the Factory property. The individual unit tests then take a simple form of validating that the object returned ...
Read now
Unlock full access