Table of Contents

Class MarkupMatchesAssertExtensions

Namespace
Bunit
Assembly
Bunit.Web.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(IElement, IEnumerable<IRenderedFragment>, string?)

Verifies that the rendered markup from the actual element matches the expected fragments, using the HtmlComparer type.

[AssertionMethod]
public static void MarkupMatches(this IElement actual, IEnumerable<IRenderedFragment> expected, string? userMessage = null)

Parameters

actual IElement

An IElement to verify.

expected IEnumerable<IRenderedFragment>

The expected markup fragments.

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 fragments.

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, IRenderedFragment, string?)

Verifies that the actual AngleSharp.Dom.INode matches the rendered markup from the expected IRenderedFragment, using the HtmlComparer type.

[AssertionMethod]
public static void MarkupMatches(this INode actual, IRenderedFragment expected, string? userMessage = null)

Parameters

actual INode

The node to verify.

expected IRenderedFragment

The expected rendered 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(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, IRenderedFragment, string?)

Verifies that the actual AngleSharp.Dom.INodeList matches the rendered markup from the expected IRenderedFragment, using the HtmlComparer type.

[AssertionMethod]
public static void MarkupMatches(this INodeList actual, IRenderedFragment expected, string? userMessage = null)

Parameters

actual INodeList

The list of nodes to verify.

expected IRenderedFragment

The expected rendered 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(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(IRenderedFragment, IRenderedFragment, string?)

Verifies that the rendered markup from the actual IRenderedFragment matches the rendered markup from the expected IRenderedFragment, using the HtmlComparer type.

[AssertionMethod]
public static void MarkupMatches(this IRenderedFragment actual, IRenderedFragment expected, string? userMessage = null)

Parameters

actual IRenderedFragment

The rendered fragment to verify.

expected IRenderedFragment

The expected rendered 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(IRenderedFragment, RenderFragment, string?)

Verifies that the rendered markup from the actual IRenderedFragment matches the rendered markup from the expected RenderFragment, using the HtmlComparer type.

[AssertionMethod]
public static void MarkupMatches(this IRenderedFragment actual, RenderFragment expected, string? userMessage = null)

Parameters

actual IRenderedFragment

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.

Exceptions

HtmlEqualException

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

MarkupMatches(IRenderedFragment, string, string?)

Verifies that the rendered markup from the actual IRenderedFragment matches the expected markup, using the HtmlComparer type.

[AssertionMethod]
public static void MarkupMatches(this IRenderedFragment actual, string expected, string? userMessage = null)

Parameters

actual IRenderedFragment

The rendered fragment 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>, IRenderedFragment, string?)

Verifies that the rendered markup from the actual elements matches the expected fragment, using the HtmlComparer type.

[AssertionMethod]
public static void MarkupMatches(this IEnumerable<IElement> actual, IRenderedFragment expected, string? userMessage = null)

Parameters

actual IEnumerable<IElement>

A list of elements to verify.

expected IRenderedFragment

The expected markup fragment.

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 fragment.

MarkupMatches(IEnumerable<IElement>, IEnumerable<IRenderedFragment>, 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<IRenderedFragment> expected, string? userMessage = null)

Parameters

actual IEnumerable<IElement>

A list of elements to verify.

expected IEnumerable<IRenderedFragment>

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, IRenderedFragment, string?)

Verifies that the rendered markup from the actual markup fragment matches the expected IRenderedFragment, using the HtmlComparer type.

[AssertionMethod]
public static void MarkupMatches(this string actual, IRenderedFragment expected, string? userMessage = null)

Parameters

actual string

The markup fragment to verify.

expected IRenderedFragment

The expected IRenderedFragment.

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.

Progress Telerik

Premium sponsor: Progress Telerik.

Packt

Editorial support provided by Packt.

.NET Foundation

Supported by the .NET Foundation.