Esempio n. 1
0
        public async Task PostBlogElementNullServiceTest()
        {
            var blogElement = new BlogElementBuilder().Build();
            var controller  = new DataControllerBuilder()
                              .WithMainContentService(new MainContentServiceBuilder().Build())
                              .Build();

            var result = await controller.PostBlog(null);

            result.Should().BeFalse();

            result = await controller.PostBlog(new BlogElementRequest());

            result.Should().BeFalse();
        }
Esempio n. 2
0
        public async Task PostBlogElementTest(bool saveStatus, bool expected)
        {
            var blogElement    = new BlogElementBuilder().Build();
            var contentService = new BlogContentServiceBuilder()
                                 .WithSaveStatus(saveStatus)
                                 .Build();
            var controller = new DataControllerBuilder()
                             .WithBlogContentService(contentService)
                             .Build();

            var result = await controller.PostBlog(new BlogElementRequest()
            {
                BlogElement = blogElement
            });

            result.Should().Be(expected);
        }