public void PromotionEngineTest_CalculateWrongTotal() { //Arrange int actualTotal = 270; Dictionary <string, int> userCart = new Dictionary <string, int>(); userCart.Add("A", 5); PromotionEngine pe = new PromotionEngine(); //Act int total = pe.CalculateTotalAfterPromotions(userCart); //Assert Assert.AreEqual(actualTotal, total, 0, "Wrong Total"); }
static void Main(string[] args) { Dictionary <string, int> CustomerOrders = new Dictionary <string, int>(); string input; Console.WriteLine("Enter the product and quanity by comma seperated"); for (int i = 0; i < 4; i++) { input = Console.ReadLine(); string[] words = input.Split(','); CustomerOrders.Add(words[0].ToUpper(), Convert.ToInt32(words[1])); } PromotionEngine pe = new PromotionEngine(); Console.WriteLine(pe.CalculateTotalAfterPromotions(CustomerOrders)); Console.ReadKey(); }
public void PromotionEngineTest_CalculateTotal() { //Arrange int actualTotal = 205; Dictionary <string, int> userCart = new Dictionary <string, int>(); userCart.Add("A", 3); userCart.Add("B", 2); userCart.Add("C", 1); userCart.Add("D", 1); PromotionEngine pe = new PromotionEngine(); //Act int total = pe.CalculateTotalAfterPromotions(userCart); //Assert Assert.AreEqual(actualTotal, total, 0, "Correct Total"); }