Ejemplo n.º 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");
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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()));
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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"));
        }
Ejemplo n.º 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"));
        }
Ejemplo n.º 7
0
        public void WhenRentNewMovieMoreThanOneDay_ShouldGetTwoPoints()
        {
            var terminator = new NewRelease("Terminator");
            var rentOfTerminator = new Rental(terminator, 5);

            Assert.AreEqual(2, rentOfTerminator.Movie.CalculateFrequentRenterPoints(5), "Frequent point should be 2");
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 9
0
 public void AddRental(Rental arg)
 {
     _rentals.Add(arg);
 }