public void CalculateTest_Book1_Buy_one_Book2_Buy_one_Book3_Buy_one_Price_270() { //arrange var target = new Books(); var booksInfo = new ViewModelBooks { Price = 0, BookQty = new int[] { 1, 1, 1 } }; //act target.CalculatePrice(booksInfo); //assert var expected = 270; Assert.AreEqual(expected, booksInfo.Price); }
public void CalculateTest_Book1_Buy_two_Book2_Buy_five_Book3_Buy_three_Book4_Buy_Four_Book5_Buy_Two_Price_935() { //arrange var target = new Books(); var booksInfo = new ViewModelBooks { Price = 0, BookQty = new int[] { 2, 5, 3, 4, 2 } }; //act target.CalculatePrice(booksInfo); //assert var expected = 935; Assert.AreEqual(expected, booksInfo.Price); }