Beispiel #1
0
        public async Task GetDefaultBlogPageTest(int maxResults)
        {
            var controller = new DataControllerBuilder().Build();

            var blogElements = await controller.GetBlogPage("201901", maxResults);

            blogElements.Should().NotBeNull();
        }
        public async Task WithNullMainContentService()
        {
            var controller = new DataControllerBuilder()
                             .WithMainContentService(null)
                             .Build();

            var result = await controller.GetBlogPage("201901", 1);

            result.Should().NotBeNull(ResultEmptyList);
        }
        public async Task WithMainContentService()
        {
            var controller = new DataControllerBuilder()
                             .WithMainContentService(
                new MainContentServiceBuilder()
                .WithLanguageMainContent(
                    new MainContentBuilder().Build(),
                    Language.English)
                .Build())
                             .Build();

            var result = await controller.GetBlogPage("201901", 1);

            result.Should().NotBeNull(ResultEmptyList);
        }
Beispiel #4
0
        public async Task GetBlogPageTest()
        {
            var blogElement    = new BlogElementBuilder().Build();
            var contentService = new BlogContentServiceBuilder()
                                 .WithBlogElements(new List <BlogElement>()
            {
                blogElement
            })
                                 .Build();
            var controller = new DataControllerBuilder()
                             .WithBlogContentService(contentService)
                             .Build();

            var blogElements = await controller.GetBlogPage("201901", 0);

            blogElements.Should().NotBeEmpty();
            blogElements.First().Should().Be(blogElement);
        }