Table of Contents

Class CompareToExtensions

Namespace
Bunit
Assembly
bunit.dll

Extension methods that allows different rendered fragments to be compared to others or strings.

public static class CompareToExtensions
Inheritance
CompareToExtensions
Inherited Members

Methods

CompareTo(INode, INodeList)

Compares an actual AngleSharp.Dom.INode with an expected AngleSharp.Dom.INodeList.

public static IReadOnlyList<IDiff> CompareTo(this INode actual, INodeList expected)

Parameters

actual INode

The node to check.

expected INodeList

The node list to compare with.

Returns

IReadOnlyList<IDiff>

Any differences found.

CompareTo(INodeList, INode)

Compares an actual AngleSharp.Dom.INodeList with an expected AngleSharp.Dom.INode.

public static IReadOnlyList<IDiff> CompareTo(this INodeList actual, INode expected)

Parameters

actual INodeList

The node list to check.

expected INode

The node to compare with.

Returns

IReadOnlyList<IDiff>

Any differences found.

CompareTo(INodeList, INodeList)

Compares an actual AngleSharp.Dom.INodeList with an expected AngleSharp.Dom.INodeList.

public static IReadOnlyList<IDiff> CompareTo(this INodeList actual, INodeList expected)

Parameters

actual INodeList

The node list to check.

expected INodeList

The node list to compare with.

Returns

IReadOnlyList<IDiff>

Any differences found.

CompareTo<TComponent>(IRenderedComponent<TComponent>, string)

Compare the rendered markup in the actual IRenderedComponent<TComponent> with that in the expected markup string.

public static IReadOnlyList<IDiff> CompareTo<TComponent>(this IRenderedComponent<TComponent> actual, string expected) where TComponent : IComponent

Parameters

actual IRenderedComponent<TComponent>

Source of rendered markup to check.

expected string

Markup to compare with.

Returns

IReadOnlyList<IDiff>

Any differences found.

Type Parameters

TComponent

CompareTo<TActualComponent, TExpectedComponent>(IRenderedComponent<TActualComponent>, IRenderedComponent<TExpectedComponent>)

Compare the rendered markup in the actual IRenderedComponent<TComponent> to the rendered markup in the expected IRenderedComponent<TComponent>.

public static IReadOnlyList<IDiff> CompareTo<TActualComponent, TExpectedComponent>(this IRenderedComponent<TActualComponent> actual, IRenderedComponent<TExpectedComponent> expected) where TActualComponent : IComponent where TExpectedComponent : IComponent

Parameters

actual IRenderedComponent<TActualComponent>

Source of rendered markup to check.

expected IRenderedComponent<TExpectedComponent>

Source of rendered markup to compare with.

Returns

IReadOnlyList<IDiff>

Any differences found.

Type Parameters

TActualComponent
TExpectedComponent
.NET Foundation

Supported by the .NET Foundation.