Esempio n. 1
0
        public async Task NotIncludeAnyLockedCampaigns()
        {
            // Arrange
            var handler = new ActiveOrUpcomingCampaignsQueryHandler(Context);

            // Act
            var result = await handler.Handle(new ActiveOrUpcomingCampaignsQuery());

            // Assert
            result.ShouldNotBeNull();
            result.Any(x => x.Name == Locked).ShouldBeFalse();
        }
        public async Task NotIncludeAnyLockedCampaigns()
        {
            // Arrange
            var handler = new ActiveOrUpcomingCampaignsQueryHandler(Context);

            // Act
            var result = await handler.Handle(new ActiveOrUpcomingCampaignsQuery());

            // Assert
            result.ShouldNotBeNull();
            result.Any(x => x.Name == Locked).ShouldBeFalse();
        }
        public async Task ReturnExpectedNumberOfCampaigns()
        {
            // Arrange
            var handler = new ActiveOrUpcomingCampaignsQueryHandler(Context, Now);

            // Act
            var result = await handler.Handle(new ActiveOrUpcomingCampaignsQuery());

            // Assert
            result.ShouldNotBeNull();
            result.Count.ShouldBe(4);
        }
Esempio n. 4
0
        public async Task ReturnCampaignsWhoseEndDateTimeIsGreaterThanOrEqualToToday()
        {
            // Arrange
            var handler = new ActiveOrUpcomingCampaignsQueryHandler(Context)
            {
                DateTimeOffsetUtcNow = () => DateTimeOffsetNow
            };

            // Act
            var result = await handler.Handle(new ActiveOrUpcomingCampaignsQuery());

            // Assert
            result.ShouldNotBeNull();
            result.Count.ShouldBe(4);
        }