public void AddToCardTest_vol1_1_vol2_1_vol3_1_vol4_1_total_should_be_320() { // Arrange PotterBook vol1 = new PotterBook { Volumn = 1 }; PotterBook vol2 = new PotterBook { Volumn = 2 }; PotterBook vol4 = new PotterBook { Volumn = 4 }; PotterBook vol3 = new PotterBook { Volumn = 3 }; var target = new PotterShoppingCart(); var expected = 320; // Action target.AddToCard(vol1, 1); target.AddToCard(vol2, 1); target.AddToCard(vol3, 1); target.AddToCard(vol4, 1); // Assert Assert.AreEqual(expected, target.getTotal()); }
public void AddToCardTest_vol1_1_total_should_be_100() { // Arrange PotterBook vol1 = new PotterBook { Volumn = 1 }; var target = new PotterShoppingCart(); var expected = 100; // Action target.AddToCard(vol1,1); // Assert Assert.AreEqual(expected,target.getTotal()); }
public int GetPriceForPottersTest(int[] bookAmounts) { var target = new PotterShoppingCart(); for (var i = 0; i < 5; i++) { if (bookAmounts[i] > 0) { target.AddPotterBook(Potters[i], bookAmounts[i]); } } return(target.Checkout()); }
public void AddToCardTest_vol1_1_total_should_be_100() { // Arrange PotterBook vol1 = new PotterBook { Volumn = 1 }; var target = new PotterShoppingCart(); var expected = 100; // Action target.AddToCard(vol1, 1); // Assert Assert.AreEqual(expected, target.getTotal()); }
public void AddToCardTest_vol1_1_vol2_1_vol3_1_vol4_1_total_should_be_320() { // Arrange PotterBook vol1 = new PotterBook { Volumn = 1 }; PotterBook vol2 = new PotterBook { Volumn = 2 }; PotterBook vol4 = new PotterBook { Volumn = 4 }; PotterBook vol3 = new PotterBook { Volumn = 3 }; var target = new PotterShoppingCart(); var expected = 320; // Action target.AddToCard(vol1,1); target.AddToCard(vol2,1); target.AddToCard(vol3,1); target.AddToCard(vol4,1); // Assert Assert.AreEqual(expected, target.getTotal()); }