public void 第一集_1_第二集_3_第三集_3_第四集_5_第五集_2_應為1165() { //arrange var cal = new PotterShoppingCart_Class(); cal.BuyFirst(1); cal.BuySecond(3); cal.BuyThird(3); cal.BuyForth(5); cal.BuyFifth(2); //act var actual = cal.Caltotal(); //assert var expected = 1165; Assert.AreEqual(expected, actual); }
public void 一次買了整套_一二三四五集各買了一本_價格應為_375() { //arrange var cal = new PotterShoppingCart_Class(); cal.BuyFirst(1); cal.BuySecond(1); cal.BuyThird(1); cal.BuyForth(1); cal.BuyFifth(1); //act var actual = cal.Caltotal(); //assert var expected = 375; Assert.AreEqual(expected, actual); }