Table of Contents

Method ForEqualValuesWithError

Namespace
Xunit.Sdk
Assembly
xunit.v3.assert.dll

ForEqualValuesWithError(string, string, Exception?, string?)

Creates a new instance of NotEqualException to be thrown when two values are equal. This may be simple values (like intrinsics) or complex values (like classes or structs). Used when an error has occurred during comparison.

public static NotEqualException ForEqualValuesWithError(string expected, string actual, Exception? error = null, string? banner = null)

Parameters

expected string

The expected value

actual string

The actual value

error Exception

The optional exception that was thrown during comparison

banner string

The banner to show; if null, then the standard banner of "Values are equal" will be used. If error is not null, then the banner used will always be "Exception thrown during comparison", regardless of the value passed here.

Returns