Table of Contents

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

actual IElement

An element to verify.

expected IEnumerable<IElement>

A list of elements.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual element does not match the expected elements.

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

actual INode

The node to verify.

expected INodeList

The expected list of nodes.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual INode

The markup to verify.

expected RenderFragment

The render fragment whose output to compare against.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual INode

The node to verify.

expected string

The expected markup.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual INodeList

The list of nodes to verify.

expected INode

The expected node.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual INodeList

The list of nodes to verify.

expected INodeList

The expected list of nodes.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual INodeList

The markup to verify.

expected RenderFragment

The render fragment whose output to compare against.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual INodeList

The list of nodes to verify.

expected string

The expected markup.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual IEnumerable<IElement>

A list of elements to verify.

expected IEnumerable<IRenderedComponent<IComponent>>

A list of fragments.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual elements does not match the expected fragments.

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

actual IEnumerable<IElement>

A enumerable of IElements to verify.

expected string

The expected markup fragment.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual string

The markup fragment to verify.

expected INode

The expected AngleSharp.Dom.INode.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual string

The markup fragment to verify.

expected INodeList

The expected AngleSharp.Dom.INodeList.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual string

The markup fragment to verify.

expected string

The expected markup fragment.

userMessage string

A custom user message to display in case the verification fails.

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual IElement

An IElement to verify.

expected IEnumerable<IRenderedComponent<TComponent>>

The expected markup fragments.

userMessage string

A custom user message to display in case the verification fails.

Type Parameters

TComponent

Exceptions

HtmlEqualException

Thrown when the actual element does not match the expected fragments.

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

actual INode

The node to verify.

expected IRenderedComponent<TComponent>

The expected rendered fragment.

userMessage string

A custom user message to display in case the verification fails.

Type Parameters

TComponent

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual INodeList

The list of nodes to verify.

expected IRenderedComponent<TComponent>

The expected rendered fragment.

userMessage string

A custom user message to display in case the verification fails.

Type Parameters

TComponent

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual IRenderedComponent<TComponent>

The rendered fragment to verify.

expected RenderFragment

The render fragment whose output to compare against.

userMessage string

A custom user message to display in case the verification fails.

Type Parameters

TComponent

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual IRenderedComponent<TComponent>

The rendered fragment to verify.

expected string

The expected markup.

userMessage string

A custom user message to display in case the verification fails.

Type Parameters

TComponent

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual IEnumerable<IElement>

A list of elements to verify.

expected IRenderedComponent<TComponent>

The expected markup fragment.

userMessage string

A custom user message to display in case the verification fails.

Type Parameters

TComponent

Exceptions

HtmlEqualException

Thrown when the actual elements does not match the expected fragment.

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

actual string

The markup fragment to verify.

expected IRenderedComponent<TComponent>

The expected IRenderedComponent<TComponent>.

userMessage string

A custom user message to display in case the verification fails.

Type Parameters

TComponent

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

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

actual IRenderedComponent<TActualComponent>

The rendered fragment to verify.

expected IRenderedComponent<TExpectedComponent>

The expected rendered fragment.

userMessage string

A custom user message to display in case the verification fails.

Type Parameters

TActualComponent
TExpectedComponent

Exceptions

HtmlEqualException

Thrown when the actual markup does not match the expected markup.

.NET Foundation

Supported by the .NET Foundation.