示例#1
0
        public void 只買第1集1本_價錢合計100元()
        {
            //Arrange
            var target = new Bill();
            var Product = new List<Potter> { new Potter { BookClass = 1, BookName = "哈利波特1", Amount = 1, Price = 100 } };

            int expected = 100;
            //Act
            int actual = target.Checkout(Product);
            //Assert
            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void 第1集1本第2集1本第3集1本_價格應為270()
        {
            //Arrange
            var target = new Bill();
            var Product = new List<Potter> { 
                new Potter { BookClass = 1, BookName = "哈利波特1", Amount = 1, Price = 100 },
                new Potter { BookClass = 2, BookName = "哈利波特2", Amount = 1, Price = 100 },
                new Potter { BookClass = 3, BookName = "哈利波特3", Amount = 1, Price = 100 } 
            };

            int expected = 270;
            //Act
            int actual = target.Checkout(Product);
            //Assert
            Assert.AreEqual(expected, actual);
        }