public async Task DoesNotRenderLinkIfNoImage() { // Given TestExecutionContext context = new TestExecutionContext(); TestDocument document = new TestDocument(); KeyValuePair <string, string>[] args = new KeyValuePair <string, string>[] { new KeyValuePair <string, string>("Link", "/c/d"), new KeyValuePair <string, string>("Target", "abc"), new KeyValuePair <string, string>("Rel", "def"), new KeyValuePair <string, string>("Alt", "ghi"), new KeyValuePair <string, string>("Class", "jkl"), new KeyValuePair <string, string>("Height", "100px"), new KeyValuePair <string, string>("Width", "200px") }; FigureShortcode shortcode = new FigureShortcode(); // When TestDocument result = (TestDocument)await shortcode.ExecuteAsync(args, "foo bar", document, context); // Then result.Content.ShouldBe( @"<figure class=""jkl""> <figcaption>foo bar</figcaption> </figure>", StringCompareShould.IgnoreLineEndings); }
public async Task RendersFigureWithoutLink() { // Given TestExecutionContext context = new TestExecutionContext(); TestDocument document = new TestDocument(); KeyValuePair <string, string>[] args = new KeyValuePair <string, string>[] { new KeyValuePair <string, string>("Src", "/a/b"), new KeyValuePair <string, string>("Alt", "ghi"), new KeyValuePair <string, string>("Class", "jkl"), new KeyValuePair <string, string>("Height", "100px"), new KeyValuePair <string, string>("Width", "200px") }; FigureShortcode shortcode = new FigureShortcode(); // When TestDocument result = (TestDocument)await shortcode.ExecuteAsync(args, "foo bar", document, context); // Then result.Content.ShouldBe( @"<figure class=""jkl""> <img src=""/a/b"" alt=""ghi"" height=""100px"" width=""200px"" /> <figcaption>foo bar</figcaption> </figure>", StringCompareShould.IgnoreLineEndings); }