public void WhenCatalogContainsItem_GetReturnsItem() { IMyCatalogItem mockItem = Substitute.For <IMyCatalogItem>(); MyItemCatalog systemUnderTest = new MyItemCatalog(new Dictionary <string, IMyCatalogItem>() { { "SomeId", mockItem } }); Assert.AreEqual(mockItem, systemUnderTest.GetItem("SomeId")); }
public void WhenCatalogDoesNotContainItem_GetReturnsNull() { MyItemCatalog systemUnderTest = new MyItemCatalog(new Dictionary <string, IMyCatalogItem>()); Assert.IsNull(systemUnderTest.GetItem("SomeId")); }