public void TestfindAllProducts() { Lab2.Product product = new Lab2.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab2.Product product2 = new Lab2.Product(2, "strugure", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab2.Product product3 = new Lab2.Product(3, "albina", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab2.ProductRepository productRepository = new Lab2.ProductRepository(product, product2, product3); Assert.AreEqual(3, productRepository.findAllProducts().Count, "List of products incomplete"); }
public void TestRemoveProductByname() { Lab2.Product product = new Lab2.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab2.Product product2 = new Lab2.Product(2, "strugure", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab2.Product product3 = new Lab2.Product(3, "albina", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab2.ProductRepository productRepository = new Lab2.ProductRepository(product, product2, product3); productRepository.RemoveProductByName("albina"); Assert.AreEqual(2, productRepository.findAllProducts().Count, "Product not removed"); }