public void TestRemoveProduct() { ProductDistributor producer = new ProductDistributor(); Product testProduct = ProductFlyweightFactory.MakeProduct(); producer.AddProduct(testProduct); producer.RemoveProduct(testProduct); Assert.IsEmpty(producer.GetAvailableGames()); }
public void TestAddAndRemoveMoreGames() { ProductDistributor producer = new ProductDistributor(); Product testProduct = ProductFlyweightFactory.MakeProduct(); Product testProduct2 = ProductFlyweightFactory.MakeProduct(); Product testProduct3 = ProductFlyweightFactory.MakeProduct(); producer.AddProduct(testProduct); producer.AddProduct(testProduct2); producer.AddProduct(testProduct3); producer.RemoveProduct(testProduct2); int testAvailableGames = producer.GetAvailableGames().Count; Assert.AreEqual(2, testAvailableGames); }