Table of Contents

Method ForMismatch

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

ForMismatch(object?, object?, int, Exception?, AssertEqualityResult?)

Creates an instance of AssertEqualityResult where the values were not equal, and there is a single mismatch index (for example, when comparing two collections).

public static AssertEqualityResult ForMismatch(object? x, object? y, int mismatchIndex, Exception? exception = null, AssertEqualityResult? innerResult = null)

Parameters

x object

The left-hand value in the comparison

y object

The right-hand value in the comparison

mismatchIndex int

The mismatch index for both X and Y values

exception Exception

The optional exception that was thrown to cause the failure

innerResult

The optional inner result that caused the equality failure

Returns

ForMismatch(object?, object?, int, int, Exception?, AssertEqualityResult?)

Creates an instance of AssertEqualityResult where the values were not equal, and there are separate mismatch indices (for example, when comparing two strings under special circumstances).

public static AssertEqualityResult ForMismatch(object? x, object? y, int mismatchIndexX, int mismatchIndexY, Exception? exception = null, AssertEqualityResult? innerResult = null)

Parameters

x object

The left-hand value in the comparison

y object

The right-hand value in the comparison

mismatchIndexX int

The mismatch index for the X value

mismatchIndexY int

The mismatch index for the Y value

exception Exception

The optional exception that was thrown to cause the failure

innerResult

The optional inner result that caused the equality failure

Returns