diff --git a/tests/Elastic.Markdown.Tests/CodeBlocks/CallOutTests.cs b/tests/Elastic.Markdown.Tests/CodeBlocks/CallOutTests.cs index cf4a70c13..0d3189d69 100644 --- a/tests/Elastic.Markdown.Tests/CodeBlocks/CallOutTests.cs +++ b/tests/Elastic.Markdown.Tests/CodeBlocks/CallOutTests.cs @@ -118,21 +118,23 @@ public void ParsesMagicCallOuts() => Block!.CallOuts [Fact] public void RendersExpectedHtml() => - Html.ReplaceLineEndings().Should().Contain(""" -
-
-
var x = 1;
-		                      var y = x - 2;
-		                      var z = y - 2;
-		                      
-
-
-

OUTPUT:

-
    -
  1. Marking the first callout
  2. -
  3. Marking the second callout
  4. -
- """.ReplaceLineEndings()); + Html.ShouldBeHtml( + """ +
+
+
var x = 1;
+					  var y = x - 2;
+					  var z = y - 2;
+					
+
+
+

OUTPUT:

+
    +
  1. Marking the first callout
  2. +
  3. Marking the second callout
  4. +
+ """ + ); [Fact] @@ -367,12 +369,14 @@ public void ParsesCallouts() => Block!.CallOuts [Fact] public void RenderedHtmlContainsCallouts() => - Html.ReplaceLineEndings().Should().Contain(""" -
    -
  1. First callout
  2. -
  3. Second callout
  4. -
- """.ReplaceLineEndings()); + Html.ShouldContainHtml( + """ +
    +
  1. First callout
  2. +
  3. Second callout
  4. +
+ """ + ); } public class CodeBlockWithMultipleCommentTypesThenList(ITestOutputHelper output) : CodeBlockCallOutTests(output, "csharp", @@ -426,10 +430,15 @@ public void ParsesCallouts() => Block!.CallOuts [Fact] public void RendersIntermediateParagraph() => - Html.ReplaceLineEndings().Should().Contain(""" -

This is an intermediate paragraph

-
    - """.ReplaceLineEndings()); + Html.ShouldContainHtml( + """ +

    This is an intermediate paragraph

    +
      +
    1. First callout
    2. +
    3. Second callout
    4. +
    + """ + ); } public class CodeBlockWithCommentBlocksTwoParagraphsThenList(ITestOutputHelper output) : CodeBlockCallOutTests(output, "csharp", diff --git a/tests/Elastic.Markdown.Tests/FileInclusion/IncludeTests.cs b/tests/Elastic.Markdown.Tests/FileInclusion/IncludeTests.cs index ce0269283..7be8a1d9e 100644 --- a/tests/Elastic.Markdown.Tests/FileInclusion/IncludeTests.cs +++ b/tests/Elastic.Markdown.Tests/FileInclusion/IncludeTests.cs @@ -31,10 +31,7 @@ protected override void AddToFileSystem(MockFileSystem fileSystem) [Fact] public void IncludesInclusionHtml() => - Html.Should() - .Contain("Hello world") - .And.Be("

    Hello world

    ") - ; + Html.ShouldBeHtml("

    Hello world

    "); } diff --git a/tests/Elastic.Markdown.Tests/Inline/AnchorLinkTests.cs b/tests/Elastic.Markdown.Tests/Inline/AnchorLinkTests.cs index a939884df..df39ee5f8 100644 --- a/tests/Elastic.Markdown.Tests/Inline/AnchorLinkTests.cs +++ b/tests/Elastic.Markdown.Tests/Inline/AnchorLinkTests.cs @@ -56,8 +56,7 @@ public class InPageAnchorTests(ITestOutputHelper output) : AnchorLinkTestBase(ou { [Fact] public void GeneratesHtml() => - // language=html - Html.Should().Contain( + Html.ShouldContainHtml( """

    Hello

    """ ); diff --git a/tests/Elastic.Markdown.Tests/Inline/CommentTest.cs b/tests/Elastic.Markdown.Tests/Inline/CommentTest.cs index 3c8337aff..ebd941efc 100644 --- a/tests/Elastic.Markdown.Tests/Inline/CommentTest.cs +++ b/tests/Elastic.Markdown.Tests/Inline/CommentTest.cs @@ -14,18 +14,21 @@ not a comment { [Fact] - public void GeneratesAttributesInHtml() => + public void GeneratesAttributesInHtml() + { // language=html Html.Should().NotContain( - """

    % comment""" - ) - .And.Contain( - """

    not a comment

    """ - ).And.Be( + """

    % comment""" + ) + .And.Contain( + """

    not a comment

    """ + ); + Html.ShouldBeHtml( """

    not a comment

    """ ); + } } public class MultipleLineCommentTest(ITestOutputHelper output) : InlineTest(output, @@ -43,23 +46,27 @@ also not a comment { [Fact] - public void GeneratesAttributesInHtml() => + public void GeneratesAttributesInHtml() + { // language=html - Html.ReplaceLineEndings().Should().NotContainAny( + Html.Should().NotContainAny( "

    ") + "

    -->" + ) .And.ContainAll( "

    not a comment, and multi line comment below

    ", "

    also not a comment

    " - ).And.Be( - """ -

    not a comment, and multi line comment below

    -

    also not a comment

    - """.ReplaceLineEndings() - ); + ); + Html.ShouldBeHtml( + """ +

    not a comment, and multi line comment below

    +

    also not a comment

    + """ + ); + } } public class MultipleLineCommentWithLinkTest(ITestOutputHelper output) : InlineTest(output, @@ -80,7 +87,8 @@ also not a comment public void HasNoErrors() => Collector.Diagnostics.Should().HaveCount(0); [Fact] - public void GeneratesAttributesInHtml() => + public void GeneratesAttributesInHtml() + { // language=html Html.ReplaceLineEndings().Should().NotContainAny( "