public void PrepareFreeDaysArray_NullsPassed_ReturnsTwoWeeksAsDaysOfYear() { //Arrange var freeDays = Enumerable.Range(DateTime.Now.DayOfYear, 14); var service = new TermService(mockReservationRepository.Object); //Act var result = service.PrepareFreeDaysArray(null, null); //Assert Assert.Equal(freeDays, result); }
public void PrepareFreeDaysArray_FutureDatesPassed_ReturnsCorrectDaysOfYear() { //Arrange var rentalDate = DateTime.Now.AddDays(8); var returnDate = DateTime.Now.AddDays(12); var freeDays = Enumerable.Range(rentalDate.DayOfYear - 7, returnDate.DayOfYear - rentalDate.DayOfYear + 8); var service = new TermService(mockReservationRepository.Object); //Act var result = service.PrepareFreeDaysArray(rentalDate, returnDate); //Assert Assert.Equal(freeDays, result); }