public async Task RendersGistWithoutFile() { TestExecutionContext context = new TestExecutionContext(); TestDocument document = new TestDocument(); KeyValuePair <string, string>[] args = new KeyValuePair <string, string>[] { new KeyValuePair <string, string>(null, "abc"), new KeyValuePair <string, string>(null, "def") }; GistShortcode shortcode = new GistShortcode(); // When TestDocument result = (TestDocument)await shortcode.ExecuteAsync(args, null, document, context); // Then result.Content.ShouldBe("<script src=\"//gist.github.com/def/abc.js\" type=\"text/javascript\"></script>"); }
public void RendersGistWithoutFile() { TestExecutionContext context = new TestExecutionContext(); TestDocument document = new TestDocument(); KeyValuePair <string, string>[] args = new KeyValuePair <string, string>[] { new KeyValuePair <string, string>(null, "abc"), new KeyValuePair <string, string>(null, "def") }; GistShortcode shortcode = new GistShortcode(); // When ShortcodeResult result = shortcode.Execute(args, null, document, context); // Then result.ContentProvider.GetStream().ReadToEnd().ShouldBe("<script src=\"//gist.github.com/def/abc.js\" type=\"text/javascript\"></script>"); }