Method NotEqual
- Namespace
- Xunit
- Assembly
- xunit.v3.assert.dll
NotEqual<T>(IEnumerable<T>?, IEnumerable<T>?)
Verifies that two sequences are not equivalent, using a default comparer.
public static void NotEqual<T>(IEnumerable<T>? expected, IEnumerable<T>? actual)
Parameters
expectedIEnumerable<T>The expected object
actualIEnumerable<T>The actual object
Type Parameters
TThe type of the objects to be compared
Exceptions
Thrown when the objects are equal
NotEqual<T>(IEnumerable<T>?, IEnumerable<T>?, IEqualityComparer<T>)
Verifies that two sequences are not equivalent, using a custom equality comparer.
public static void NotEqual<T>(IEnumerable<T>? expected, IEnumerable<T>? actual, IEqualityComparer<T> comparer)
Parameters
expectedIEnumerable<T>The expected object
actualIEnumerable<T>The actual object
comparerIEqualityComparer<T>The comparer used to compare the two objects
Type Parameters
TThe type of the objects to be compared
Exceptions
Thrown when the objects are equal
NotEqual<T>(IEnumerable<T>?, IEnumerable<T>?, Func<T, T, bool>)
Verifies that two collections are not equal, using a comparer function against items in the two collections.
public static void NotEqual<T>(IEnumerable<T>? expected, IEnumerable<T>? actual, Func<T, T, bool> comparer)
Parameters
expectedIEnumerable<T>The expected value
actualIEnumerable<T>The value to be compared against
comparerFunc<T, T, bool>The function to compare two items for equality
Type Parameters
TThe type of the objects to be compared
NotEqual<T>(T[], T[])
Verifies that two arrays of un-managed type T are not equal, using Span<T>.SequenceEqual.
public static void NotEqual<T>(T[] expected, T[] actual) where T : unmanaged, IEquatable<T>
Parameters
expectedT[]The expected value
actualT[]The value to be compared against
Type Parameters
TThe type of items whose arrays are to be compared
NotEqual<T>(T, T)
Verifies that two objects are not equal, using a default comparer.
public static void NotEqual<T>(T expected, T actual)
Parameters
expectedTThe expected object
actualTThe actual object
Type Parameters
TThe type of the objects to be compared
NotEqual<T>(T, T, Func<T, T, bool>)
Verifies that two objects are not equal, using a custom equality comparer function.
public static void NotEqual<T>(T expected, T actual, Func<T, T, bool> comparer)
Parameters
expectedTThe expected object
actualTThe actual object
comparerFunc<T, T, bool>The comparer used to examine the objects
Type Parameters
TThe type of the objects to be compared
NotEqual<T>(T, T, IEqualityComparer<T>)
Verifies that two objects are not equal, using a custom equality comparer.
public static void NotEqual<T>(T expected, T actual, IEqualityComparer<T> comparer)
Parameters
expectedTThe expected object
actualTThe actual object
comparerIEqualityComparer<T>The comparer used to examine the objects
Type Parameters
TThe type of the objects to be compared
NotEqual(double, double, int)
Verifies that two double values are not equal, within the number of decimal
places given by precision.
public static void NotEqual(double expected, double actual, int precision)
Parameters
expecteddoubleThe expected value
actualdoubleThe value to be compared against
precisionintThe number of decimal places (valid values: 0-15)
NotEqual(double, double, int, MidpointRounding)
Verifies that two double values are not equal, within the number of decimal
places given by precision. The values are rounded before comparison.
The rounding method to use is given by rounding
public static void NotEqual(double expected, double actual, int precision, MidpointRounding rounding)
Parameters
expecteddoubleThe expected value
actualdoubleThe value to be compared against
precisionintThe number of decimal places (valid values: 0-15)
roundingMidpointRoundingRounding method to use to process a number that is midway between two numbers
NotEqual(double, double, double)
Verifies that two double values are not equal, within the tolerance given by
tolerance (positive or negative).
public static void NotEqual(double expected, double actual, double tolerance)
Parameters
expecteddoubleThe expected value
actualdoubleThe value to be compared against
tolerancedoubleThe allowed difference between values
NotEqual(float, float, int)
Verifies that two float values are not equal, within the number of decimal
places given by precision.
public static void NotEqual(float expected, float actual, int precision)
Parameters
expectedfloatThe expected value
actualfloatThe value to be compared against
precisionintThe number of decimal places (valid values: 0-15)
NotEqual(float, float, int, MidpointRounding)
Verifies that two float values are not equal, within the number of decimal
places given by precision. The values are rounded before comparison.
The rounding method to use is given by rounding
public static void NotEqual(float expected, float actual, int precision, MidpointRounding rounding)
Parameters
expectedfloatThe expected value
actualfloatThe value to be compared against
precisionintThe number of decimal places (valid values: 0-15)
roundingMidpointRoundingRounding method to use to process a number that is midway between two numbers
NotEqual(float, float, float)
Verifies that two float values are not equal, within the tolerance given by
tolerance (positive or negative).
public static void NotEqual(float expected, float actual, float tolerance)
Parameters
expectedfloatThe expected value
actualfloatThe value to be compared against
tolerancefloatThe allowed difference between values
NotEqual(decimal, decimal, int)
Verifies that two decimal values are not equal, within the number of decimal
places given by precision.
public static void NotEqual(decimal expected, decimal actual, int precision)