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"); }
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(); }