コード例 #1
0
        public void PotterShoppingCartTests_第一集買了1本_第二集也買了1本_價格應為_190()
        {
            //arrange
            var Buy = new PotterShoppingCart();

            //act
            var actual = Buy.CalTotalPay(1, 1, 0, 0, 0);

            //assert
            var expected = 190;
            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void PotterShoppingCartTests_第一集買了一本_其他都沒買_價格應為_100元()
        {
            //arrange
            var Buy = new PotterShoppingCart();

            //act
            var actual = Buy.CalTotalPay(1, 0, 0, 0, 0);

            //assert
            var expected = 100;
            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void PotterShoppingCartTests_一二集各買了一本_第三集買了兩本_價格應為_370()
        {
            //arrange
            var Buy = new PotterShoppingCart();

            //act
            var actual = Buy.CalTotalPay(1, 1, 2, 0, 0);

            //assert
            var expected = 370;
            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void PotterShoppingCartTests_買了一整套_價格應為_375()
        {
            //arrange
            var Buy = new PotterShoppingCart();

            //act
            var actual = Buy.CalTotalPay(1, 1, 1, 1, 1);

            //assert
            var expected = 375;
            Assert.AreEqual(expected, actual);
        }