Exemplo n.º 1
0
            public async Task ReturnsContent()
            {
                // Given
                TestExecutionContext context   = new TestExecutionContext();
                TestDocument         document  = new TestDocument();
                IShortcode           shortcode = new TestShortcode("Foo");

                // When
                IEnumerable <IDocument> result = await shortcode.ExecuteAsync(null, null, document, context);

                // Then
                result.ShouldHaveSingleItem().ShouldBeOfType <TestDocument>().Content.ShouldBe("Foo");
            }
Exemplo n.º 2
0
            public async Task ReturnsNullForEmptyContent()
            {
                // Given
                TestExecutionContext context   = new TestExecutionContext();
                TestDocument         document  = new TestDocument();
                IShortcode           shortcode = new TestShortcode(string.Empty);

                // When
                IEnumerable <IDocument> result = await shortcode.ExecuteAsync(null, null, document, context);

                // Then
                result.ShouldBeNull();
            }