public void TwoDaysRentalNewReleaseTest() { MoviePriceState moviePriceState = new MoviePriceStateNewRelease(); int daysRented = 2; var rentalPrice = moviePriceState.GetRentalPrice(daysRented); var pointsEarned = moviePriceState.GetFrecuentRentalPoints(daysRented); Assert.AreEqual(6, rentalPrice); Assert.AreEqual(2, pointsEarned); }
public void LessThanADaysRentalNewReleasePriceThrowsExceptionTest() { MoviePriceState moviePriceState = new MoviePriceStateNewRelease(); int daysRented = 0; Exception expectedException = null; try { var result = moviePriceState.GetRentalPrice(daysRented); } catch (Exception ex) { expectedException = ex; } Assert.IsNotNull(expectedException); Assert.IsInstanceOfType(expectedException, typeof(ArgumentException)); Assert.AreEqual("Days rented must be positive.", expectedException.Message); }