public void Movie_TitleAndTypeAreCorrect() { var CinderellaChildrenMovie = MovieFactory.GetMovieByName(MovieTitles.Cinderella); var StarWarsRegularMovie = MovieFactory.GetMovieByName(MovieTitles.StarWars); var GladiatorNewReleaseMovie = MovieFactory.GetMovieByName(MovieTitles.Gladiator); Assert.AreEqual(CinderellaChildrenMovie.GetName(), MovieTitles.Cinderella); Assert.AreEqual(StarWarsRegularMovie.GetName(), MovieTitles.StarWars); Assert.AreEqual(GladiatorNewReleaseMovie.GetName(), MovieTitles.Gladiator); Assert.AreEqual(CinderellaChildrenMovie.GetPricingCode(), PriceCodes.Childrens); Assert.AreEqual(StarWarsRegularMovie.GetPricingCode(), PriceCodes.Regular); Assert.AreEqual(GladiatorNewReleaseMovie.GetPricingCode(), PriceCodes.NewRelease); }
public void Init() { // Create movies _mCinderella = MovieFactory.GetMovieByName("Cinderella"); _mStarWars = MovieFactory.GetMovieByName("Star Wars"); _mGladiator = MovieFactory.GetMovieByName("Gladiator"); // Create rentals _mRental1 = new Rental(_mCinderella, 5); _mRental2 = new Rental(_mStarWars, 5); _mRental3 = new Rental(_mGladiator, 5); // Create customers _mMickeyMouse = new Customer("Mickey Mouse"); }
public void CustomerStatement() { Customer Mickey = new Customer("Mickey Mouse"); Rental rental1 = new Rental(MovieFactory.GetMovieByName(MovieTitles.Cinderella), 5); Rental rental2 = new Rental(MovieFactory.GetMovieByName(MovieTitles.StarWars), 5); Rental rental3 = new Rental(MovieFactory.GetMovieByName(MovieTitles.Gladiator), 5); Mickey.AddRental(rental1); Mickey.AddRental(rental2); Mickey.AddRental(rental3); var statement = Mickey.Statement(); Approvals.Verify(statement); }
public void RentalPrice_ChildrenMovie_AfterMaxRentalDays() { Rental ChildrenRental = new Rental(MovieFactory.GetMovieByName(MovieTitles.Cinderella), 10); Assert.AreEqual(ChildrenRental.GetPrice(), 12); }
public void RentalPrice_NewReleaseMovie() { Rental NewReleaseRental = new Rental(MovieFactory.GetMovieByName(MovieTitles.Gladiator), 4); Assert.AreEqual(NewReleaseRental.GetPrice(), 12); }
public void RentalPrice_RegularMovie_AfterMaxRentalDays() { Rental RegularRental = new Rental(MovieFactory.GetMovieByName(MovieTitles.StarWars), 10); Assert.AreEqual(RegularRental.GetPrice(), 14); }
public void Movie_UnknownMovieType_ExpectionAxpected() { Assert.Throws <Exception>(() => MovieFactory.GetMovieByName("This movie does not exist")); }