public async Task NotIncludeAnyExpiredEvents() { // Arrange var handler = new ActiveOrUpcomingEventsQueryHandler(Context); // Act var result = await handler.Handle(new ActiveOrUpcomingEventsQuery()); // Assert result.ShouldNotBeNull(); result.Any(x => x.Name == Expired).ShouldBeFalse(); }
public async Task NotReturnEventsForNotPublishedCampaigns() { // Arrange var handler = new ActiveOrUpcomingEventsQueryHandler(Context); // Act var result = await handler.Handle(new ActiveOrUpcomingEventsQuery()); // Assert result.ShouldNotBeNull(); result.Any(x => x.Name == EventForNotPublishedCampaign).ShouldBeFalse(); }
public async Task ReturnEventsWhoseEndDateTimeIsGreaterThanOrEqualToToday() { // Arrange var handler = new ActiveOrUpcomingEventsQueryHandler(Context) { DateTimeOffsetUtcNow = () => DateTimeOffsetNow }; // Act var result = await handler.Handle(new ActiveOrUpcomingEventsQuery()); // Assert result.ShouldNotBeNull(); result.Count.ShouldBe(4); }