コード例 #1
0
        public void SetPriceCodeForMovie()
        {
            Movie newMovie = new Movie("Movie Title 6: Title Rebirthed", new ChildrensMovie());
            Assert.That(2 == newMovie.type.GetPriceCode());

            newMovie.type = new RegularMovie();
            Assert.That(0 == newMovie.type.GetPriceCode());
        }
コード例 #2
0
        public void CreatingAndSettingRentalData(Int32 defaultRentalDays)
        {
            Movie defaultMovie = new Movie("Test Movie 1: The Reckoning...", new ChildrensMovie());
            Rental testRental = new Rental(defaultMovie, defaultRentalDays);

            Assert.That(defaultMovie, Is.EqualTo(testRental.GetMovie()));
            Assert.That(defaultRentalDays, Is.EqualTo(testRental.GetDaysRented()));
        }
コード例 #3
0
ファイル: Rental.cs プロジェクト: ImpulseChimp/CodingKatas
 public Rental(Movie movie, Int32 daysRented)
 {
     this.movie = movie;
     this.daysRented = daysRented;
 }