Class ShouldBeTextChangeAssertExtensions
- Namespace
- Bunit
- Assembly
- Bunit.Web.dll
Verification helpers for text.
public static class ShouldBeTextChangeAssertExtensions
- Inheritance
-
ShouldBeTextChangeAssertExtensions
- Inherited Members
Methods
ShouldBeAttributeChange(IDiff, string, string, string?)
Verifies that the actualChange
diff is a change to the value of the specific attribute (expectedAttrName
).
public static void ShouldBeAttributeChange(this IDiff actualChange, string expectedAttrName, string expectedAttrValue, string? userMessage = null)
Parameters
actualChange
IDiffThe actual change that has happened.
expectedAttrName
stringThe expected name of the changed attribute.
expectedAttrValue
stringThe expected value of the changed attribute.
userMessage
stringA custom user message to show when the verification fails.
ShouldBeTextChange(IDiff, INodeList, string?)
Verifies that a diff is a change to a text node.
public static void ShouldBeTextChange(this IDiff actualChange, INodeList expectedChange, string? userMessage = null)
Parameters
actualChange
IDiffThe diff to verify.
expectedChange
INodeListThe node list containing the expected text change.
userMessage
stringA custom error message to show if the verification fails.
ShouldBeTextChange(IDiff, IRenderedFragment, string?)
Verifies that a diff is a change to a text node.
public static void ShouldBeTextChange(this IDiff actualChange, IRenderedFragment expectedChange, string? userMessage = null)
Parameters
actualChange
IDiffThe diff to verify.
expectedChange
IRenderedFragmentThe rendered fragment containing the expected text change.
userMessage
stringA custom error message to show if the verification fails.
ShouldBeTextChange(IDiff, string, string?)
Verifies that a diff is a change to a text node.
public static void ShouldBeTextChange(this IDiff actualChange, string expectedChange, string? userMessage = null)
Parameters
actualChange
IDiffThe diff to verify.
expectedChange
stringThe expected text change.
userMessage
stringA custom error message to show if the verification fails.
ShouldHaveSingleTextChange(IEnumerable<IDiff>, string, string?)
Verifies that a list of diffs contains only a single change, and that change is a change to a text node.
public static void ShouldHaveSingleTextChange(this IEnumerable<IDiff> diffs, string expectedChange, string? userMessage = null)
Parameters
diffs
IEnumerable<IDiff>The list of diffs to verify against.
expectedChange
stringThe expected text change.
userMessage
stringA custom error message to show if the verification fails.