コード例 #1
0
        public void GetStatement_StringStatementIsProperlyGenerated_OneDayRentalOfRegularMovie()
        {
            var result = _statementBuilder.GetStringOfCustomerName("TestCustomer");
            result += _statementBuilder.GetStringOfRentalForCurrentMovie("Inception", 2);
            result += _statementBuilder.GetStringOfTotalRental(2);
            result += _statementBuilder.GetStringOfFrequentRenterPoints(1);

            var movie = new Movie("Inception");
            var customer = new Customer("TestCustomer");
            var rentalList = new List<Rental> { new RentalForRegularMovie(daysRented: 1) { Movie = movie } };
            customer.Rentals = rentalList;
            Assert.IsTrue(result.Equals(customer.GetStatement(new StringStatement())));
        }
コード例 #2
0
ファイル: Rental.cs プロジェクト: Confirmit/Students
 public Rental(Movie movie, int daysRented)
 {
     Movie = movie;
     DaysRented = daysRented;
 }