public void RentalCtor_MovieGetter()
        {
            // arrange
            var expectedMovie = new Movie(string.Empty, Movie.Regular);

            // act
            var rental = new Rental(expectedMovie, 0);
            var actualMovie = rental.Movie;

            // assert
            Assert.AreEqual<Movie>(expectedMovie, actualMovie);
        }
        public void AddRental()
        {
            // arrange
            var movie = new Movie(string.Empty, Movie.Regular);
            var rental = new Rental(movie, 1);
            var customer = new Customer("equo");

            // act
            customer.AddRental(rental);

            // assert
            ;
        }
        public void RentalCtor_DaysRentedGetter()
        {
            // arrange
            var movie = new Movie(string.Empty, Movie.Regular);
            int expectedDaysRented = 1;

            // act
            var rental = new Rental(movie, expectedDaysRented);
            int actualDaysRented = rental.DaysRented;

            // assert
            Assert.AreEqual<int>(expectedDaysRented, actualDaysRented);
        }
        public void GetFrequentRenterPoint_RegularMoreThan1Days()
        {
            // arrange
            var movie = new Movie(string.Empty, Movie.Regular);
            var rental = new Rental(movie, 2);
            int expectedFrequentRenterPoints = 1;

            // act
            int actualFrequentRenterPoints = rental.GetFrequentRenterPoints();

            // assert
            Assert.AreEqual<int>(expectedFrequentRenterPoints, actualFrequentRenterPoints);
        }
        public void GetFrequentRenterPoint_NewReleaseLessOrEqual1Days()
        {
            // arrange
            var movie = new Movie(string.Empty, Movie.NewRelease);
            var rental = new Rental(movie, 1);
            int expectedFrequentRenterPoints = 1;

            // act
            int actualFrequentRenterPoints = rental.GetFrequentRenterPoints();

            // assert
            Assert.AreEqual<int>(expectedFrequentRenterPoints, actualFrequentRenterPoints);
        }
        public void HtmlStatement_ChildrensMoreThan3Days()
        {
            // arrange
            var customer = new Customer("equo");
            var movie = new Movie("fuga", Movie.Childrens);
            var rental = new Rental(movie, 4);
            customer.AddRental(rental);
            string expectedHtmlStatement =
                "<h1>Rentals for <em>equo</em></h1><p>" + "\n" +
                "fuga: 3<br>" + "\n" +
                "<p>You owe <em>3</em><p>" + "\n" +
                "On this rental you earned <em>1</em> frequent renter points<p>";

            // act
            string actualHtmlStatement = customer.HtmlStatement();

            // assert
            Assert.AreEqual<string>(expectedHtmlStatement, actualHtmlStatement);
        }
 private double AmountFor(Rental rental)
 {
     return rental.GetCharge();
 }
 public void AddRental(Rental arg)
 {
     rentals.Add(arg);
 }
        public void HtmlStatement_NewReleaseLessOrEqual1Days()
        {
            // arrange
            var customer = new Customer("equo");
            var movie = new Movie("piyo", Movie.NewRelease);
            var rental = new Rental(movie, 1);
            customer.AddRental(rental);
            string expectedHtmlStatement =
                "<h1>Rentals for <em>equo</em></h1><p>" + "\n" +
                "piyo: 3<br>" + "\n" +
                "<p>You owe <em>3</em><p>" + "\n" +
                "On this rental you earned <em>1</em> frequent renter points<p>";

            // act
            string actualHtmlStatement = customer.HtmlStatement();

            // assert
            Assert.AreEqual<string>(expectedHtmlStatement, actualHtmlStatement);
        }
        public void Statement_RegularMoreThan2Days()
        {
            // arrange
            var customer = new Customer("equo");
            var movie = new Movie("hoge", Movie.Regular);
            var rental = new Rental(movie, 3);
            customer.AddRental(rental);
            string expectedStatement =
                "Rental Record for equo" + "\n" +
                "\t" + "hoge" + "\t" + "3.5" + "\n" +
                "Amount owed is 3.5" + "\n" +
                "You earned 1 frequent renter points";

            // act
            string actualStatement = customer.Statement();

            // assert
            Assert.AreEqual<string>(expectedStatement, actualStatement);
        }
        public void Statement_NewReleasMoreThan1Days()
        {
            // arrange
            var customer = new Customer("equo");
            var movie = new Movie("piyo", Movie.NewRelease);
            var rental = new Rental(movie, 2);
            customer.AddRental(rental);
            string expectedStatement =
                "Rental Record for equo" + "\n" +
                "\t" + "piyo" + "\t" + "6" + "\n" +
                "Amount owed is 6" + "\n" +
                "You earned 2 frequent renter points";

            // act
            string actualStatement = customer.Statement();

            // assert
            Assert.AreEqual<string>(expectedStatement, actualStatement);
        }
        public void Statement_ChildrensMoreThan3Days()
        {
            // arrange
            var customer = new Customer("equo");
            var movie = new Movie("fuga", Movie.Childrens);
            var rental = new Rental(movie, 4);
            customer.AddRental(rental);
            string expectedStatement =
                "Rental Record for equo" + "\n" +
                "\t" + "fuga" + "\t" + "3" + "\n" +
                "Amount owed is 3" + "\n" +
                "You earned 1 frequent renter points";

            // act
            string actualStatement = customer.Statement();

            // assert
            Assert.AreEqual<string>(expectedStatement, actualStatement);
        }
        public void HtmlStatement_RegularMoreThan2Days()
        {
            // arrange
            var customer = new Customer("equo");
            var movie = new Movie("hoge", Movie.Regular);
            var rental = new Rental(movie, 3);
            customer.AddRental(rental);
            string expectedHtmlStatement =
                "<h1>Rentals for <em>equo</em></h1><p>" + "\n" +
                "hoge: 3.5<br>" + "\n" +
                "<p>You owe <em>3.5</em><p>" + "\n" +
                "On this rental you earned <em>1</em> frequent renter points<p>";

            // act
            string actualHtmlStatement = customer.HtmlStatement();

            // assert
            Assert.AreEqual<string>(expectedHtmlStatement, actualHtmlStatement);
        }