public void TotalUpServiceSetUp() { var catalog = new Catalogue(); catalog.AddProduct(new Product("A13", 0.50m, "Apple")); catalog.AddProduct(new Product("C45", 1.50m, "Chicken")); catalog.AddProduct(new Product("B15", 2.50m, "Beans")); catalog.AddProduct(new Product("T23", 1.00m, "Tea")); catalog.AddOffer(new Offer("A13", 3, 1.00m)); catalog.AddOffer(new Offer("C45", 4, 4.00m)); TotalService = new TotalUpService(catalog); }
public void AddOfferToExistingProduct() { var offer = new Offer("A12", 3, 00.50m); Catalogue.AddProduct(new Product("A12", 00.25m, "Apples")); Catalogue.AddOffer(offer); Assert.AreEqual(Catalogue.GetOffer("A12"), offer); }
public Catalogue CreateCatalogue() { var catalogue = new Catalogue(); try { catalogue.AddProduct(new Product("A13", 0.50m, "Apple")); catalogue.AddProduct(new Product("C45", 1.50m, "Chicken")); catalogue.AddProduct(new Product("B15", 2.50m, "Beans")); catalogue.AddProduct(new Product("T23", 1.00m, "Tea")); catalogue.AddProduct(new Product("B16", 1.50m, "Bannana")); catalogue.AddProduct(new Product("B78", 2.50m, "Beer")); catalogue.AddProduct(new Product("W13", 4.50m, "Wine")); catalogue.AddOffer(new Offer("A13", 3, 1.00m)); } catch (Exception ex) { Console.WriteLine(ex.Message); } return(catalogue); }