public void TestGetRentalPeriod_ReturnMonthlyPeriod_IfPeriodTypeIsMonthly() { var tenant = new TenantEntity { PeriodType = RentPeriodType.Monthly, PaidTo = new DateTime(2009, 12, 1) }; var rentalPeriod = tenant.GetRentalPeriod() as MonthlyRentalPeriod; Assert.IsNotNull(rentalPeriod); Assert.AreEqual(new DateTime(2009, 12, 1), rentalPeriod.PeriodStartDate); }
public void TestGetRentalPeriod_Return4WeeklyPeriod_IfPeriodTypeIsFourWeekly() { var tenant = new TenantEntity { PeriodType = RentPeriodType.FourWeekly, PaidTo = new DateTime(2009, 12, 1) }; var rentalPeriod = tenant.GetRentalPeriod() as WeeklyRentalPeriod; Assert.IsNotNull(rentalPeriod); Assert.AreEqual(new DateTime(2009, 12, 1), rentalPeriod.PeriodStartDate); Assert.AreEqual(4, rentalPeriod.NumberOfWeeksInPeriod); }
public void TestGetRentalPeriod_ReturnMonthlyPeriod_PaidToLastDay() { var tenant = new TenantEntity { PeriodType = RentPeriodType.Monthly, PaidTo = new DateTime(2009, 12, 1), PaidToLastDay = true }; var rentalPeriod = tenant.GetRentalPeriod() as MonthlyRentalPeriod; Assert.IsTrue(rentalPeriod.PaidToLastDayOfMonth); }