public static void Test1_RentalAddRentalDays() { Renatal rental = new Renatal(movie, days: 6); rental.AddRentalDays(); Assert.AreEqual(rental.CalculateDebt(), 2 * 7); rental.AddRentalDays(2); Assert.AreEqual(rental.CalculateDebt(), 2 * 9); }
public static void Test1_RentalSubstractRentalDays() { Renatal rental = new Renatal(movie, days: 6); rental.SubstractRentalDays(); Assert.AreEqual(rental.CalculateDebt(), 2 * 5); rental.SubstractRentalDays(2); Assert.AreEqual(rental.CalculateDebt(), 2 * 3); }
public static void Case1_RentalSubstractRentalDays() { Renatal rental = new Renatal(movie, 6); rental.SubstractRentalDays(); Assert.AreEqual(rental.CalculateDebt(), rental.Movie.RentalPrice * (6 - 1)); rental.SubstractRentalDays(2); Assert.AreEqual(rental.CalculateDebt(), rental.Movie.RentalPrice * (6 - 3)); }
public static void Case1_RentalAddRentalDays() { Renatal rental = new Renatal(movie, 6); rental.AddRentalDays(); Assert.AreEqual(rental.CalculateDebt(), rental.Movie.RentalPrice * (6 + 1)); rental.AddRentalDays(2); Assert.AreEqual(rental.CalculateDebt(), rental.Movie.RentalPrice * (6 + 3)); }
public static void Test1_ExpectedRentalDaysException2() { try { Renatal rental = new Renatal(movie, days: -6); } catch (RentalDaysException e) { Assert.AreEqual(e.Days, -6); } catch (Exception) { Assert.Fail(); } }
public static void Test1_ExpectedRentalDaysException1() { try { Renatal rental = new Renatal(movie, days: 6); rental.SubstractRentalDays(7); } catch (RentalDaysException e) { Assert.AreEqual(e.Days, -1); } catch (Exception) { Assert.Fail(); } }
public static void Test2_NewReleaseMovie() { Renatal rental = new Renatal(new NewReleaseMovie("Film1"), days: 6); Assert.AreEqual(rental.CalculateDebt(), 18); }
public static void Test2_ChildrensMovie() { Renatal rental = new Renatal(new ChildrensMovie("Film1"), days: 6); Assert.AreEqual(rental.CalculateDebt(), 6); }
public static void Test2_RegularMovie() { Renatal rental = new Renatal(new RegularMovie("Film1"), days: 6); Assert.AreEqual(rental.CalculateDebt(), 12); }
public static void Test1_RentalCalculateDebt() { Renatal rental = new Renatal(movie, days: 6); Assert.AreEqual(rental.CalculateDebt(), 12); }
public static void Test2_MoviesTypes() { Renatal rental = new Renatal(Movie.RegularMovie("Movie Name"), days: 6); Assert.AreEqual(rental.CalculateDebt(), 12); }
public static void Case1_RentalCalculateDebt() { Renatal rental = new Renatal(movie, 6); Assert.AreEqual(rental.CalculateDebt(), rental.Movie.RentalPrice * rental.Days); }