public void RentalFamilyTest() { //Creates the collection of rentals List <IRental> listRentals = new List <IRental>(); listRentals.Add(new RentalHour() { cantRent = 9 }); listRentals.Add(new RentalDay() { cantRent = 3 }); listRentals.Add(new RentalWeek() { cantRent = 12 }); FamilyRental rf = new FamilyRental(listRentals); //The function calculation for the total of the cost double totalCost = rf.CalcCost(); Assert.AreEqual(totalCost, 577.5); }
public void RentalFamilyTestFailNoPromotion() { //Creates the collection of rentals List <IRental> listRentals = new List <IRental>(); listRentals.Add(new RentalHour() { cantRent = 9 }); listRentals.Add(new RentalDay() { cantRent = 3 }); FamilyRental rf = new FamilyRental(listRentals); try { //The function calculation for the total of the cost double totalCost = rf.CalcCost(); Assert.Fail("Without promocion"); } catch (Exception ex) { // whatever logging code } }
public void RentalFamilyTestFailNoRentals() { //Creates the collection of rentals List <IRental> listRentals = new List <IRental>(); FamilyRental rf = new FamilyRental(listRentals); try { //The function calculation for the total of the cost double totalCost = rf.CalcCost(); Assert.Fail("Without rents"); } catch (Exception ex) { // whatever logging code } }