public void TestProductRepositoryConstructor() { Lab3NS.Product product = new Lab3NS.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.Product product2 = new Lab3NS.Product(2, "strugure", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.Product product3 = new Lab3NS.Product(3, "albina", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.ProductRepository productRepository = new Lab3NS.ProductRepository(product, product2, product3); }
public void TestfindAllProducts() { Lab3NS.Product product = new Lab3NS.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.Product product2 = new Lab3NS.Product(2, "strugure", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.Product product3 = new Lab3NS.Product(3, "albina", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.ProductRepository productRepository = new Lab3NS.ProductRepository(product, product2, product3); Assert.AreEqual(3, productRepository.findAllProducts().Count, "List of products incomplete"); }
public void TestGetProductByPosition() { Lab3NS.Product product = new Lab3NS.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.Product product2 = new Lab3NS.Product(2, "strugure", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.Product product3 = new Lab3NS.Product(3, "albina", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.ProductRepository productRepository = new Lab3NS.ProductRepository(product, product2, product3); Assert.AreEqual(product, productRepository.GetProductbyPosition(1), "Wrong product returned"); }
public void TestAddProduct() { Lab3NS.Product product = new Lab3NS.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.Product product2 = new Lab3NS.Product(2, "strugure", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.Product product3 = new Lab3NS.Product(3, "albina", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Lab3NS.ProductRepository productRepository = new Lab3NS.ProductRepository(product, product2, product3); Lab3NS.Product product4 = new Lab3NS.Product(4, "gelu", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); productRepository.AddProduct(product4); Assert.AreEqual(product4, productRepository.GetProductByName("gelu"), "Product not added"); }
public void TestComputeVATForInvalidOutput() { Lab3NS.Product product = new Lab3NS.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 15.5, 25); Assert.AreNotEqual(product.ComputeVAT(), 19, "This shouldn't be equal"); }
public void TestComputeVATGivenValidData() { Lab3NS.Product product = new Lab3NS.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 15.5, 25); Assert.AreEqual(product.ComputeVAT(), 19.375, "This should be equal"); }
public void TestIsValidGivenEndDateBefortToday() { Lab3NS.Product product = new Lab3NS.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2017, 12, 14), 20, 30); Assert.AreEqual(product.IsValid(), false, "This should be false"); }
public void TestIsValidGivenCorrectData() { Lab3NS.Product product = new Lab3NS.Product(1, "ceapa", "de mancat", new System.DateTime(2011, 12, 13), new System.DateTime(2019, 12, 14), 20, 30); Assert.AreEqual(product.IsValid(), true, "This should be true"); }