コード例 #1
0
        public void Statement_WhenCustomerHaveSingleRental_Shouldpass()
        {
            const int    daysRented                   = 3;
            const double expectedTotalAmount          = 9;
            const int    expectedFrequentRenterPoints = 2;

            RentalFactory.GetRentalInformation(Titles[0], TypeOfMovie.NewRelease, daysRented);
            var customerRentals = RentalFactory.Build();

            StatementFactory.GetCustomerRental(CustomerName, customerRentals);
            var statement = StatementFactory.BuildStatement();

            TestsHelper.SetCustomerInformation(CustomerName, expectedTotalAmount, expectedFrequentRenterPoints);
            TestsHelper.SetMovieInformation(TestsHelper.GetMoviesWithPrice(customerRentals));

            Assert.True(TestsHelper.CheckStatement(statement));
            Assert.True(TestsHelper.CheckStringStatement(StatementFactory.BuildStringStatement()));
            Assert.True(TestsHelper.CheckJsonStatement(StatementFactory.BuildJsonStatement()));
            Assert.True(TestsHelper.CheckUniversalStatement(StatementFactory.BuildUniversalStatement()));
        }
コード例 #2
0
        public void Statement__WhenCustomerHaveMultipleRentals_Shouldpass(int regularMovieDays, int childrensMovieDays,
                                                                          int newReleaseMovieDays,
                                                                          double expectedTotalAmount, int expectedFrequentRenterPoints)
        {
            var days = new[] { newReleaseMovieDays, regularMovieDays, childrensMovieDays };

            RentalFactory.GetRentalInformation(Titles, Types, days);
            var customerRentals = RentalFactory.Build();

            StatementFactory.GetCustomerRental(CustomerName, customerRentals);
            var statement = StatementFactory.BuildStatement();

            TestsHelper.SetCustomerInformation(CustomerName, expectedTotalAmount, expectedFrequentRenterPoints);
            TestsHelper.SetMovieInformation(TestsHelper.GetMoviesWithPrice(customerRentals));

            Assert.True(TestsHelper.CheckStatement(statement));
            Assert.True(TestsHelper.CheckStringStatement(StatementFactory.BuildStringStatement()));
            Assert.True(TestsHelper.CheckJsonStatement(StatementFactory.BuildJsonStatement()));
            Assert.True(TestsHelper.CheckUniversalStatement(StatementFactory.BuildUniversalStatement()));
        }