コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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);
        }