コード例 #1
0
        public void WhenGetStatement_ShouldPrintFrequentPoint()
        {
            var terminator = new Regular("Terminator");
            var john = new Customer("John");
            var rentOfTerminator = new Rental(terminator, 5);

            john.AddRental(rentOfTerminator);

            var statement = john.Statement();
            Assert.IsTrue(statement.Contains("You earned 1"), "Should be one points");
        }
コード例 #2
0
        public void WhenGetStatement_ShouldPrintMovieTitle()
        {
            var terminator = new Regular("Terminator");
            var john = new Customer("John");
            var rentOfTerminator = new Rental(terminator, 5);

            john.AddRental(rentOfTerminator);

            var statement = john.Statement();

            Assert.IsTrue(statement.Contains(terminator.Title));
        }
コード例 #3
0
        public void WhenGetStatement_ShouldPrintCustomerName()
        {
            var terminator = new Regular("Terminator");
            var john = new Customer("John");
            var rentOfTerminator = new Rental(terminator, 5);

            john.AddRental(rentOfTerminator);

            var statement = john.Statement();

            Assert.IsTrue(statement.Contains("Rental Record for " + john.GetName()));
        }
コード例 #4
0
        public void WhenGetStatement_ShouldPrintFrequentPoints()
        {
            var terminator = new Regular("Terminator");
            var xmen = new NewRelease("Xmen");
            var john = new Customer("John");
            var rentOfTerminator = new Rental(terminator, 5);
            var rentOfXmen = new Rental(xmen, 3);

            john.AddRental(rentOfTerminator);
            john.AddRental(rentOfXmen);

            var statement = john.Statement();
            Assert.IsTrue(statement.Contains("You earned 3 "), "Frequent point should be 3");
        }
コード例 #5
0
        public void WhenRentMovies_ShouldGiveRightStatement()
        {
            var terminator = new Regular("Terminator");
            var xmen = new NewRelease("Xmen");
            var john = new Customer("John");
            var rentOfTerminator = new Rental(terminator, 5);
            var rentOfXmen = new Rental(xmen, 3);

            john.AddRental(rentOfTerminator);
            john.AddRental(rentOfXmen);

            var statement = john.Statement();

            Assert.IsTrue(statement.Contains("Amount owed is 15.5"));
        }
コード例 #6
0
        public void WhenRentRegularMovie_ShouldGiveRightStatement()
        {
            var terminator = new Regular("Terminator");
            var john = new Customer("John");
            var rentOfTerminator = new Rental(terminator, 5);

            john.AddRental(rentOfTerminator);

            var statement = john.Statement();

            Assert.IsTrue(statement.Contains("Amount owed is 6.5"));
        }