public async Task GetAllEventsForAll() { var cb = new CalendarBusiness(); var sut = await cb.GetAllEvents(); sut.Should().NotBeEmpty(); sut.First().Summary.ShouldBeEquivalentTo("Anvil"); }
public async Task TodayIsSundayShouldHaveEventsForNextWeek() { TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); DateTime easternTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, easternZone); var cb = new CalendarBusiness(); var sut = await cb.GetAllEvents(false); sut.Count().Should().BeGreaterThan(1); }
public async Task GetAllEventsForWeek() { var cb = new CalendarBusiness(); var sut = await cb.GetAllEvents(false); sut.Should().NotBeEmpty(); sut.First().Summary.ShouldBeEquivalentTo("Anvil"); sut.Any(s => s.Summary == "SOBLSD").ShouldBeEquivalentTo(true); sut.FirstOrDefault(s => s.Summary == "SOBLSD").Items.EmptyIfNull().Should().HaveCount(1); }
public virtual async Task <ActionResult> All(bool all = true, bool bust = false) { var cacheKey = string.Format("{0}-{1}", "allcalenderitems", all.ToString()); if (bust) { Cache.Remove(cacheKey); } var events = await Cache.GetOrSet("CalList", async() => await CalendarBusiness.GetAllEvents(all)); return(Json(events, JsonRequestBehavior.AllowGet)); }