public void TestIdentityMapOfCategoryFinder() { int categoryId = 6; int anotherCategoryId = 8; CategoryFinder categoryFinder = new CategoryFinder(); CategoryGateway categoryGateway1 = categoryFinder.FindCategoryGatewayById(categoryId); CategoryGateway categoryGateway2 = categoryFinder.FindCategoryGatewayById(categoryId); Assert.AreEqual(categoryGateway1, categoryGateway2); CategoryGateway categoryGateway3 = categoryFinder.FindCategoryGatewayById(anotherCategoryId); Assert.AreNotEqual(categoryGateway1, categoryGateway3); Assert.AreNotEqual(categoryGateway2, categoryGateway3); }
public void TestCategoryFinder() { int categoryId = 6; CategoryFinder categoryFinder = new CategoryFinder(); CategoryGateway categoryGateway = categoryFinder.FindCategoryGatewayById(categoryId); Assert.AreEqual(categoryId, categoryGateway.CategoryID); Assert.AreEqual("Meat/Poultry", categoryGateway.CategoryName); Assert.AreEqual("Prepared meats", categoryGateway.Description); }