Class MarkupMatchesAssertExtensions
- Namespace
- Bunit
- Assembly
- bunit.dll
Assert helpers for comparing markup.
public static class MarkupMatchesAssertExtensions
- Inheritance
-
MarkupMatchesAssertExtensions
- Inherited Members
Methods
MarkupMatches(IElement, IEnumerable<IElement>, string?)
Verifies that the rendered markup from the actual elements matches
the expected elements, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches(this IElement actual, IEnumerable<IElement> expected, string? userMessage = null)
Parameters
actualIElementAn element to verify.
expectedIEnumerable<IElement>A list of elements.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualelement does not match theexpectedelements.
MarkupMatches(INode, INodeList, string?)
Verifies that the actual AngleSharp.Dom.INode matches
the expected AngleSharp.Dom.INodeList, using the HtmlComparer
type.
[AssertionMethod]
public static void MarkupMatches(this INode actual, INodeList expected, string? userMessage = null)
Parameters
actualINodeThe node to verify.
expectedINodeListThe expected list of nodes.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(INode, RenderFragment, string?)
Verifies that the markup from the actual matches
the rendered markup from the expected RenderFragment, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches(this INode actual, RenderFragment expected, string? userMessage = null)
Parameters
actualINodeThe markup to verify.
expectedRenderFragmentThe render fragment whose output to compare against.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(INode, string, string?)
Verifies that the actual AngleSharp.Dom.INode matches
the expected markup, using the HtmlComparer
type.
[AssertionMethod]
public static void MarkupMatches(this INode actual, string expected, string? userMessage = null)
Parameters
actualINodeThe node to verify.
expectedstringThe expected markup.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(INodeList, INode, string?)
Verifies that the actual AngleSharp.Dom.INodeList matches
the expected AngleSharp.Dom.INode, using the HtmlComparer
type.
[AssertionMethod]
public static void MarkupMatches(this INodeList actual, INode expected, string? userMessage = null)
Parameters
actualINodeListThe list of nodes to verify.
expectedINodeThe expected node.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(INodeList, INodeList, string?)
Verifies that the actual AngleSharp.Dom.INodeList matches
the expected AngleSharp.Dom.INodeList, using the HtmlComparer
type.
[AssertionMethod]
public static void MarkupMatches(this INodeList actual, INodeList expected, string? userMessage = null)
Parameters
actualINodeListThe list of nodes to verify.
expectedINodeListThe expected list of nodes.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(INodeList, RenderFragment, string?)
Verifies that the markup from the actual matches
the rendered markup from the expected RenderFragment, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches(this INodeList actual, RenderFragment expected, string? userMessage = null)
Parameters
actualINodeListThe markup to verify.
expectedRenderFragmentThe render fragment whose output to compare against.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(INodeList, string, string?)
Verifies that the actual AngleSharp.Dom.INodeList matches
the expected markup, using the HtmlComparer
type.
[AssertionMethod]
public static void MarkupMatches(this INodeList actual, string expected, string? userMessage = null)
Parameters
actualINodeListThe list of nodes to verify.
expectedstringThe expected markup.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(IEnumerable<IElement>, IEnumerable<IRenderedComponent<IComponent>>, string?)
Verifies that the rendered markup from the actual elements matches
the expected fragments, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches(this IEnumerable<IElement> actual, IEnumerable<IRenderedComponent<IComponent>> expected, string? userMessage = null)
Parameters
actualIEnumerable<IElement>A list of elements to verify.
expectedIEnumerable<IRenderedComponent<IComponent>>A list of fragments.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualelements does not match theexpectedfragments.
MarkupMatches(IEnumerable<IElement>, string, string?)
Verifies that the rendered markup from the actual elements
the expected markup fragment, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches(this IEnumerable<IElement> actual, string expected, string? userMessage = null)
Parameters
actualIEnumerable<IElement>A enumerable of IElements to verify.
expectedstringThe expected markup fragment.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(string, INode, string?)
Verifies that the rendered markup from the actual markup fragment matches
the expected AngleSharp.Dom.INode, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches(this string actual, INode expected, string? userMessage = null)
Parameters
actualstringThe markup fragment to verify.
expectedINodeThe expected AngleSharp.Dom.INode.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(string, INodeList, string?)
Verifies that the rendered markup from the actual markup fragment matches
the expected AngleSharp.Dom.INodeList, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches(this string actual, INodeList expected, string? userMessage = null)
Parameters
actualstringThe markup fragment to verify.
expectedINodeListThe expected AngleSharp.Dom.INodeList.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches(string, string, string?)
Verifies that the rendered markup from the actual markup fragment matches
the expected markup fragment, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches(this string actual, string expected, string? userMessage = null)
Parameters
actualstringThe markup fragment to verify.
expectedstringThe expected markup fragment.
userMessagestringA custom user message to display in case the verification fails.
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches<TComponent>(IElement, IEnumerable<IRenderedComponent<TComponent>>, string?)
Verifies that the rendered markup from the actual element matches
the expected fragments, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches<TComponent>(this IElement actual, IEnumerable<IRenderedComponent<TComponent>> expected, string? userMessage = null) where TComponent : IComponent
Parameters
actualIElementAn IElement to verify.
expectedIEnumerable<IRenderedComponent<TComponent>>The expected markup fragments.
userMessagestringA custom user message to display in case the verification fails.
Type Parameters
TComponent
Exceptions
- HtmlEqualException
Thrown when the
actualelement does not match theexpectedfragments.
MarkupMatches<TComponent>(INode, IRenderedComponent<TComponent>, string?)
Verifies that the actual AngleSharp.Dom.INode matches
the rendered markup from the expected IRenderedComponent<TComponent>, using the HtmlComparer
type.
[AssertionMethod]
public static void MarkupMatches<TComponent>(this INode actual, IRenderedComponent<TComponent> expected, string? userMessage = null) where TComponent : IComponent
Parameters
actualINodeThe node to verify.
expectedIRenderedComponent<TComponent>The expected rendered fragment.
userMessagestringA custom user message to display in case the verification fails.
Type Parameters
TComponent
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches<TComponent>(INodeList, IRenderedComponent<TComponent>, string?)
Verifies that the actual AngleSharp.Dom.INodeList matches
the rendered markup from the expected IRenderedComponent<TComponent>, using the HtmlComparer
type.
[AssertionMethod]
public static void MarkupMatches<TComponent>(this INodeList actual, IRenderedComponent<TComponent> expected, string? userMessage = null) where TComponent : IComponent
Parameters
actualINodeListThe list of nodes to verify.
expectedIRenderedComponent<TComponent>The expected rendered fragment.
userMessagestringA custom user message to display in case the verification fails.
Type Parameters
TComponent
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches<TComponent>(IRenderedComponent<TComponent>, RenderFragment, string?)
Verifies that the rendered markup from the actual IRenderedComponent<TComponent> matches
the rendered markup from the expected RenderFragment, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches<TComponent>(this IRenderedComponent<TComponent> actual, RenderFragment expected, string? userMessage = null) where TComponent : IComponent
Parameters
actualIRenderedComponent<TComponent>The rendered fragment to verify.
expectedRenderFragmentThe render fragment whose output to compare against.
userMessagestringA custom user message to display in case the verification fails.
Type Parameters
TComponent
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches<TComponent>(IRenderedComponent<TComponent>, string, string?)
Verifies that the rendered markup from the actual IRenderedComponent<TComponent> matches
the expected markup, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches<TComponent>(this IRenderedComponent<TComponent> actual, string expected, string? userMessage = null) where TComponent : IComponent
Parameters
actualIRenderedComponent<TComponent>The rendered fragment to verify.
expectedstringThe expected markup.
userMessagestringA custom user message to display in case the verification fails.
Type Parameters
TComponent
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches<TComponent>(IEnumerable<IElement>, IRenderedComponent<TComponent>, string?)
Verifies that the rendered markup from the actual elements matches
the expected fragment, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches<TComponent>(this IEnumerable<IElement> actual, IRenderedComponent<TComponent> expected, string? userMessage = null) where TComponent : IComponent
Parameters
actualIEnumerable<IElement>A list of elements to verify.
expectedIRenderedComponent<TComponent>The expected markup fragment.
userMessagestringA custom user message to display in case the verification fails.
Type Parameters
TComponent
Exceptions
- HtmlEqualException
Thrown when the
actualelements does not match theexpectedfragment.
MarkupMatches<TComponent>(string, IRenderedComponent<TComponent>, string?)
Verifies that the rendered markup from the actual markup fragment matches
the expected IRenderedComponent<TComponent>, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches<TComponent>(this string actual, IRenderedComponent<TComponent> expected, string? userMessage = null) where TComponent : IComponent
Parameters
actualstringThe markup fragment to verify.
expectedIRenderedComponent<TComponent>The expected IRenderedComponent<TComponent>.
userMessagestringA custom user message to display in case the verification fails.
Type Parameters
TComponent
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.
MarkupMatches<TActualComponent, TExpectedComponent>(IRenderedComponent<TActualComponent>, IRenderedComponent<TExpectedComponent>, string?)
Verifies that the rendered markup from the actual IRenderedComponent<TComponent> matches
the rendered markup from the expected IRenderedComponent<TComponent>, using the HtmlComparer type.
[AssertionMethod]
public static void MarkupMatches<TActualComponent, TExpectedComponent>(this IRenderedComponent<TActualComponent> actual, IRenderedComponent<TExpectedComponent> expected, string? userMessage = null) where TActualComponent : IComponent where TExpectedComponent : IComponent
Parameters
actualIRenderedComponent<TActualComponent>The rendered fragment to verify.
expectedIRenderedComponent<TExpectedComponent>The expected rendered fragment.
userMessagestringA custom user message to display in case the verification fails.
Type Parameters
TActualComponentTExpectedComponent
Exceptions
- HtmlEqualException
Thrown when the
actualmarkup does not match theexpectedmarkup.