public async Task <IActionResult> CheckAvaibillities(int roomId, DateTime date) { var timePeriods = await _context.Reservations.Where(x => x.RoomId == roomId && x.Date.Date == date).Select(x => x.TimePeriod).ToListAsync(); var Times = TimePeriods.GetAvaibillities(timePeriods); return(Ok(Times)); }
public void ShouldBeReturnTrueForPeriod8To9() { Assert.AreEqual(TimePeriods.GetAvaibillities(new List <string> { "8h - 9h" }).Count, 23); }