Exemplo n.º 1
0
        public void GetTotal_買哈利波特_壹x1_貮x1_共190()
        {
            //Arrange
            var    target = new BookShop();
            double expect = (100 + 100) * 0.95;

            //Act
            target.AddBookList(target.GetBook("哈利波特第一集"));
            target.AddBookList(target.GetBook("哈利波特第二集"));
            var actual = target.GetTotal();

            //Assert
            Assert.AreEqual(expect, actual);
        }
Exemplo n.º 2
0
        public void GetTotal_買哈利波特全套75折共375()
        {
            //Arrange
            var    target = new BookShop();
            double expect = (100 + 100 + 100 + 100 + 100) * 0.75;

            //Act
            target.AddBookList(target.GetBook("哈利波特第一集"));
            target.AddBookList(target.GetBook("哈利波特第二集"));
            target.AddBookList(target.GetBook("哈利波特第三集"));
            target.AddBookList(target.GetBook("哈利波特第四集"));
            target.AddBookList(target.GetBook("哈利波特第五集"));
            var actual = target.GetTotal();

            //Assert
            Assert.AreEqual(expect, actual);
        }
Exemplo n.º 3
0
        public void GetTotal_只買哈利波特第一集共100元()
        {
            //Arrange
            var    target = new BookShop();
            double expect = 100;

            //Act
            target.AddBookList(target.GetBook("哈利波特第一集"));
            var actual = target.GetTotal();

            //Assert
            Assert.AreEqual(expect, actual);
        }