public async Task FeaturedCampaignIncludesOrg()
        {
            // Arrange
            var handler = new FeaturedCampaignQueryHandlerAsync(Context);

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

            // Assert
            Assert.NotNull(result.Organization);
            Assert.Equal("Some Organization", result.Organization.Name);
        }
        public async Task ReturnsSingleCampaignThatIsFeatured()
        {
            // Arrange
            var handler = new FeaturedCampaignQueryHandlerAsync(Context);            

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

            // Assert
            Assert.NotNull(result);
            Assert.Equal("This is featured", result.Title);            
        }
예제 #3
0
        public async Task FeaturedCampaignIncludesOrg()
        {
            // Arrange
            var handler = new FeaturedCampaignQueryHandlerAsync(Context);

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

            // Assert
            Assert.NotNull(result.Organization);
            Assert.Equal("Some Organization", result.Organization.Name);
        }
예제 #4
0
        public async Task ReturnsSingleCampaignThatIsFeatured()
        {
            // Arrange
            var handler = new FeaturedCampaignQueryHandlerAsync(Context);

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

            // Assert
            Assert.NotNull(result);
            Assert.Equal("This is featured", result.Title);
        }
        public async Task ReturnNullIfNoCampaignsAreFeatured()
        {
            var results = Context.Campaigns.Where(x => x.Featured);
            Context.RemoveRange(results);
            Context.SaveChanges();

            // Arrange
            var handler = new FeaturedCampaignQueryHandlerAsync(Context);

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

            // Assert
            Assert.Null(result);
        }
예제 #6
0
        public async Task ReturnNullIfNoCampaignsAreFeatured()
        {
            var results = Context.Campaigns.Where(x => x.Featured);

            Context.RemoveRange(results);
            Context.SaveChanges();

            // Arrange
            var handler = new FeaturedCampaignQueryHandlerAsync(Context);

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

            // Assert
            Assert.Null(result);
        }