Skip to content

Commit

Permalink
Test CSS classes using both Bootstrap and MediaLinks
Browse files Browse the repository at this point in the history
  • Loading branch information
RudeySH committed May 12, 2020
1 parent d53128d commit ea67a29
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Markdig.Tests/TestMediaLinks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ private MarkdownPipeline GetPipeline(MediaOptions options = null)
.Build();
}

private MarkdownPipeline GetPipelineWithBootstrap(MediaOptions options = null)
{
return new MarkdownPipelineBuilder()
.UseBootstrap()
.UseMediaLinks(options)
.Build();
}

[Test]
[TestCase("![static mp4](https://sample.com/video.mp4)", "<p><video width=\"500\" height=\"281\" controls=\"\"><source type=\"video/mp4\" src=\"https://sample.com/video.mp4\"></source></video></p>\n")]
[TestCase("![static mp4](//sample.com/video.mp4)", "<p><video width=\"500\" height=\"281\" controls=\"\"><source type=\"video/mp4\" src=\"//sample.com/video.mp4\"></source></video></p>\n")]
Expand Down Expand Up @@ -83,5 +91,14 @@ public void TestCustomClass(string markdown, string expected, string klass)
}));
Assert.AreEqual(html, expected);
}

[Test]
[TestCase("![static mp4](//sample.com/video.mp4)", "<p><video class=\"img-fluid\" width=\"500\" height=\"281\" controls=\"\"><source type=\"video/mp4\" src=\"//sample.com/video.mp4\"></source></video></p>\n")]
[TestCase(@"![youtube.com](https://www.youtube.com/watch?v=mswPy5bt3TQ)", "<p><iframe src=\"https://www.youtube.com/embed/mswPy5bt3TQ\" class=\"img-fluid youtube\" width=\"500\" height=\"281\" frameborder=\"0\" allowfullscreen=\"\"></iframe></p>\n")]
public void TestWithBootstrap(string markdown, string expected)
{
string html = Markdown.ToHtml(markdown, GetPipelineWithBootstrap());
Assert.AreEqual(html, expected);
}
}
}

0 comments on commit ea67a29

Please sign in to comment.