Пример #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 WhenRentMovies_ShouldCalculateRentalAmount()
        {
            var terminator = new Regular("Terminator");
            var xmen = new NewRelease("Xmen");

            Assert.AreEqual(9, xmen.CalculatePrice(3));
            Assert.AreEqual(6.5, terminator.CalculatePrice(5));
        }
Пример #7
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"));
        }
Пример #8
0
        public void WhenRentMovie_ShouldGetOnePoint()
        {
            var terminator = new Regular("Terminator");
            var rentOfTerminator = new Rental(terminator, 5);

            Assert.AreEqual(1, rentOfTerminator.Movie.CalculateFrequentRenterPoints(5), "Frequent point should be 1");
        }