コード例 #1
0
            public static Customer GetCustomer()
            {
                const string customerName    = "Romnaka";
                var          regularMovie    = new RegularMovie("Harry Potter");
                var          childrensMovie  = new ChildrensMovie("The Lion King");
                var          newReleaseMovie = new NewReleaseMovie("Van Helsing");

                var customer = new Customer(customerName, new[]
                {
                    new Rental(regularMovie, 5),
                    new Rental(childrensMovie, 4),
                    new Rental(newReleaseMovie, 3)
                });

                return(customer);
            }
コード例 #2
0
        public void GetStatement_WhenCustomerHaveMultipleRentals_ShouldPass(int regularMovieDays, int childrensMovieDays, int newReleaseMovieDays,
            double expectedTotalAmount, int expectedFrequentRenterPoints)
        {
            const string customerName = "Romnaka";
            var regularMovie = new RegularMovie("Harry Potter");
            var childrensMovie = new ChildrensMovie("The Lion King");
            var newReleaseMovie = new NewReleaseMovie("Van Helsing");

            var customer = new Customer(customerName, new[]
            {
                new Rental(regularMovie, regularMovieDays),
                new Rental(childrensMovie, childrensMovieDays),
                new Rental(newReleaseMovie, newReleaseMovieDays)
            });

            customer.GetStatement(new StandardFormatter());

            Assert.Equal(expectedTotalAmount, customer.TotalAmount);
            Assert.Equal(expectedFrequentRenterPoints, customer.FrequentRenterPoints);
        }
コード例 #3
0
        public void GetStatement_WhenCustomerHaveMultipleRentals_ShouldPass(int regularMovieDays, int childrensMovieDays, int newReleaseMovieDays,
                                                                            double expectedTotalAmount, int expectedFrequentRenterPoints)
        {
            const string customerName    = "Romnaka";
            var          regularMovie    = new RegularMovie("Harry Potter");
            var          childrensMovie  = new ChildrensMovie("The Lion King");
            var          newReleaseMovie = new NewReleaseMovie("Van Helsing");

            var customer = new Customer(customerName, new[]
            {
                new Rental(regularMovie, regularMovieDays),
                new Rental(childrensMovie, childrensMovieDays),
                new Rental(newReleaseMovie, newReleaseMovieDays)
            });

            customer.GetStatement(new StandardFormatter());

            Assert.Equal(expectedTotalAmount, customer.TotalAmount);
            Assert.Equal(expectedFrequentRenterPoints, customer.FrequentRenterPoints);
        }
コード例 #4
0
            public static Customer GetCustomer()
            {
                const string customerName = "Romnaka";
                var regularMovie = new RegularMovie("Harry Potter");
                var childrensMovie = new ChildrensMovie("The Lion King");
                var newReleaseMovie = new NewReleaseMovie("Van Helsing");

                var customer = new Customer(customerName, new[]
                {
                    new Rental(regularMovie, 5),
                    new Rental(childrensMovie, 4),
                    new Rental(newReleaseMovie, 3)
                });

                return customer;
            }