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);            
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }