public void IBuyAndNeedPayTest_第一集買一本_價格100元() { var sut = new PotterShoppingCart(); var actual = sut.IBuy(HarryPotter1, 1).NeedPay(); var expected = 100; Assert.AreEqual(expected, actual); }
public void IBuyAndNeedPayTest_一二三集各買一本_價格270元() { var sut = new PotterShoppingCart(); var actual = sut .IBuy(HarryPotter1, 1) .IBuy(HarryPotter2, 1) .IBuy(HarryPotter3, 1) .NeedPay(); var expected = 270; Assert.AreEqual(expected, actual); }
public void IBuyAndNeedPayTest_一集買一本And二集買兩本And三集買兩本_價格460元() { var sut = new PotterShoppingCart(); var actual = sut .IBuy(HarryPotter1, 1) .IBuy(HarryPotter2, 2) .IBuy(HarryPotter3, 2) .NeedPay(); var expected = 460; Assert.AreEqual(expected, actual); }
public void IBuyAndNeedPayTest_選便宜算法_第1_2_3_4_5集買2_2_2_2_1本_價格1280元() { var sut = new PotterShoppingCart(); var actual = sut .IBuy(HarryPotter1, 2) .IBuy(HarryPotter2, 2) .IBuy(HarryPotter3, 2) .IBuy(HarryPotter4, 2) .IBuy(HarryPotter5, 1) .NeedPay(); var expected = 695; Assert.AreEqual(expected, actual); }
public void IBuyAndNeedPayTest_選便宜算法_第1_2_3_4_5集買4_4_4_3_3本_價格1390元() { var sut = new PotterShoppingCart(); var actual = sut .IBuy(HarryPotter1, 4) .IBuy(HarryPotter2, 4) .IBuy(HarryPotter3, 4) .IBuy(HarryPotter4, 3) .IBuy(HarryPotter5, 3) .NeedPay(); var expected = 1390; Assert.AreEqual(expected, actual); }