Assert Class

Definition

A collection of helper classes to test various conditions within unit tests. If the condition being tested is not met, an exception is thrown.

public class Assert
public sealed class Assert
[System.Runtime.CompilerServices.Nullable(0)]
public sealed class Assert
[System.Runtime.CompilerServices.Nullable(0)]
[System.Diagnostics.StackTraceHidden]
public sealed class Assert
public static class Assert
type Assert = class
[<System.Runtime.CompilerServices.Nullable(0)>]
type Assert = class
[<System.Runtime.CompilerServices.Nullable(0)>]
[<System.Diagnostics.StackTraceHidden>]
type Assert = class
Public Class Assert
Public NotInheritable Class Assert
Inheritance
Assert
Attributes

Constructors

Name Description
Assert()

Properties

Name Description
That

Gets the singleton instance of the Assert functionality.

Methods

Name Description
AddValueFormatter(Func<Func<Object,String>,Func<Object,String>>)

Registers a chain-of-responsibility value-formatter factory. The factory receives the next formatter in the chain and returns a new formatter; the returned formatter should either produce a string for the values it handles or delegate to next for the values it does not handle. The registration is scoped to the current asynchronous flow and is removed when the returned IDisposable is disposed.

AddValueFormatter<T>(Func<T,String>)

Registers a custom formatter that controls how values of T are rendered inside structured assertion failure messages. The registration is scoped to the current asynchronous flow (backed by AsyncLocal<T>) and is removed when the returned IDisposable is disposed.

AreAllDistinct(IEnumerable, IEqualityComparer, String, String)

Tests whether all items in the specified collection are distinct (no two elements are equal) using the supplied comparer and throws an exception if any two elements in the collection are equal.

AreAllDistinct(IEnumerable, String, String)

Tests whether all items in the specified collection are distinct (no two elements are equal) and throws an exception if any two elements in the collection are equal.

AreAllDistinct<T>(IEnumerable<T>, IEqualityComparer<T>, String, String)

Tests whether all items in the specified collection are distinct (no two elements are equal) using the supplied comparer and throws an exception if any two elements in the collection are equal.

AreAllDistinct<T>(IEnumerable<T>, String, String)

Tests whether all items in the specified collection are distinct (no two elements are equal) and throws an exception if any two elements in the collection are equal.

AreAllNotNull(IEnumerable, String, String)

Tests whether all items in the specified collection are non-null and throws an exception if any element is null.

AreAllNotNull<T>(IEnumerable<T>, String, String)

Tests whether all items in the specified collection are non-null and throws an exception if any element is null.

AreAllOfType(Type, IEnumerable, String, String, String)

Tests whether all elements in the specified collection are instances of (or derived from) the expected type and throws an exception if the expected type is not in the inheritance hierarchy of one or more of the elements, or if any element is null.

AreAllOfType<TExpected>(IEnumerable, String, String)

Tests whether all elements in the specified collection are instances of (or derived from) the expected type and throws an exception if the expected type is not in the inheritance hierarchy of one or more of the elements, or if any element is null.

AreEqual(Decimal, Decimal, Decimal, Assert+AssertNonGenericAreEqualInterpolatedStringHandler, String, String)

Tests whether the specified decimals are equal and throws an exception if they are not equal.

AreEqual(Decimal, Decimal, Decimal, Assert+AssertNonGenericAreEqualInterpolatedStringHandler)

Tests whether the specified decimals are equal and throws an exception if they are not equal.

AreEqual(Decimal, Decimal, Decimal, String, Object[])

Tests whether the specified decimals are equal and throws an exception if they are not equal.

AreEqual(Decimal, Decimal, Decimal, String, String, String)

Tests whether the specified decimals are equal and throws an exception if they are not equal.

AreEqual(Decimal, Decimal, Decimal, String)

Tests whether the specified decimals are equal and throws an exception if they are not equal.

AreEqual(Decimal, Decimal, Decimal)

Tests whether the specified decimals are equal and throws an exception if they are not equal.

AreEqual(Double, Double, Double, Assert+AssertNonGenericAreEqualInterpolatedStringHandler, String, String)

Tests whether the specified doubles are equal and throws an exception if they are not equal.

AreEqual(Double, Double, Double, Assert+AssertNonGenericAreEqualInterpolatedStringHandler)

Tests whether the specified doubles are equal and throws an exception if they are not equal.

AreEqual(Double, Double, Double, String, Object[])

Tests whether the specified doubles are equal and throws an exception if they are not equal.

AreEqual(Double, Double, Double, String, String, String)

Tests whether the specified doubles are equal and throws an exception if they are not equal.

AreEqual(Double, Double, Double, String)

Tests whether the specified doubles are equal and throws an exception if they are not equal.

AreEqual(Double, Double, Double)

Tests whether the specified doubles are equal and throws an exception if they are not equal.

AreEqual(Int64, Int64, Int64, Assert+AssertNonGenericAreEqualInterpolatedStringHandler, String, String)

Tests whether the specified longs are equal and throws an exception if they are not equal.

AreEqual(Int64, Int64, Int64, Assert+AssertNonGenericAreEqualInterpolatedStringHandler)

Tests whether the specified longs are equal and throws an exception if they are not equal.

AreEqual(Int64, Int64, Int64, String, Object[])

Tests whether the specified longs are equal and throws an exception if they are not equal.

AreEqual(Int64, Int64, Int64, String, String, String)

Tests whether the specified longs are equal and throws an exception if they are not equal.

AreEqual(Int64, Int64, Int64, String)

Tests whether the specified longs are equal and throws an exception if they are not equal.

AreEqual(Int64, Int64, Int64)

Tests whether the specified longs are equal and throws an exception if they are not equal.

AreEqual(Object, Object, String, Object[])

Tests whether the specified objects are equal and throws an exception if the two objects are not equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

AreEqual(Object, Object, String)

Tests whether the specified objects are equal and throws an exception if the two objects are not equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

AreEqual(Object, Object)

Tests whether the specified objects are equal and throws an exception if the two objects are not equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

AreEqual(Single, Single, Single, Assert+AssertNonGenericAreEqualInterpolatedStringHandler, String, String)

Tests whether the specified floats are equal and throws an exception if they are not equal.

AreEqual(Single, Single, Single, Assert+AssertNonGenericAreEqualInterpolatedStringHandler)

Tests whether the specified floats are equal and throws an exception if they are not equal.

AreEqual(Single, Single, Single, String, Object[])

Tests whether the specified floats are equal and throws an exception if they are not equal.

AreEqual(Single, Single, Single, String, String, String)

Tests whether the specified floats are equal and throws an exception if they are not equal.

AreEqual(Single, Single, Single, String)

Tests whether the specified floats are equal and throws an exception if they are not equal.

AreEqual(Single, Single, Single)

Tests whether the specified floats are equal and throws an exception if they are not equal.

AreEqual(String, String, Boolean, Assert+AssertNonGenericAreEqualInterpolatedStringHandler, String, String)

Tests whether the specified strings are equal and throws an exception if they are not equal. The invariant culture is used for the comparison.

AreEqual(String, String, Boolean, Assert+AssertNonGenericAreEqualInterpolatedStringHandler)

Tests whether the specified strings are equal and throws an exception if they are not equal. The invariant culture is used for the comparison.

AreEqual(String, String, Boolean, CultureInfo, Assert+AssertNonGenericAreEqualInterpolatedStringHandler, String, String)

Tests whether the specified strings are equal and throws an exception if they are not equal.

AreEqual(String, String, Boolean, CultureInfo, Assert+AssertNonGenericAreEqualInterpolatedStringHandler)

Tests whether the specified strings are equal and throws an exception if they are not equal.

AreEqual(String, String, Boolean, CultureInfo, String, Object[])

Tests whether the specified strings are equal and throws an exception if they are not equal.

AreEqual(String, String, Boolean, CultureInfo, String, String, String)

Tests whether the specified strings are equal and throws an exception if they are not equal.

AreEqual(String, String, Boolean, CultureInfo, String)

Tests whether the specified strings are equal and throws an exception if they are not equal.

AreEqual(String, String, Boolean, CultureInfo)

Tests whether the specified strings are equal and throws an exception if they are not equal.

AreEqual(String, String, Boolean, String, Object[])

Tests whether the specified strings are equal and throws an exception if they are not equal. The invariant culture is used for the comparison.

AreEqual(String, String, Boolean, String, String, String)

Tests whether the specified strings are equal and throws an exception if they are not equal. The invariant culture is used for the comparison.

AreEqual(String, String, Boolean, String)

Tests whether the specified strings are equal and throws an exception if they are not equal. The invariant culture is used for the comparison.

AreEqual(String, String, Boolean)

Tests whether the specified strings are equal and throws an exception if they are not equal. The invariant culture is used for the comparison.

AreEqual<T>(IEquatable<T>, IEquatable<T>, Assert.AssertAreEqualInterpolatedStringHandler<T>)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(IEquatable<T>, IEquatable<T>, String, Object[])

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(IEquatable<T>, IEquatable<T>, String)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(IEquatable<T>, IEquatable<T>)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(T, T, Assert.AssertAreEqualInterpolatedStringHandler<T>, String, String)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(T, T, Assert.AssertAreEqualInterpolatedStringHandler<T>)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(T, T, IEqualityComparer<T>, Assert.AssertAreEqualInterpolatedStringHandler<T>, String, String)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the provided comparer parameter.

AreEqual<T>(T, T, IEqualityComparer<T>, Assert.AssertAreEqualInterpolatedStringHandler<T>)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the provided comparer parameter.

AreEqual<T>(T, T, IEqualityComparer<T>, String, Object[])

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the provided comparer parameter.

AreEqual<T>(T, T, IEqualityComparer<T>, String, String, String)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the provided comparer parameter.

AreEqual<T>(T, T, IEqualityComparer<T>, String)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the provided comparer parameter.

AreEqual<T>(T, T, IEqualityComparer<T>)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(T, T, String, Object[])

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(T, T, String, String, String)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(T, T, String)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEqual<T>(T, T)

Tests whether the specified values are equal and throws an exception if the two values are not equal. The equality is computed using the default EqualityComparer<T>.

AreEquivalent<T>(T, T, Boolean, String, String, String)

Tests whether two object graphs are structurally equivalent (deep equality) and throws an exception if they are not.

AreEquivalent<T>(T, T, String, String, String)

Tests whether two object graphs are structurally equivalent (deep equality) and throws an exception if they are not.

AreNotEqual(Decimal, Decimal, Decimal, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler, String, String)

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Decimal, Decimal, Decimal, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Decimal, Decimal, Decimal, String, Object[])

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Decimal, Decimal, Decimal, String, String, String)

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Decimal, Decimal, Decimal, String)

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Decimal, Decimal, Decimal)

Tests whether the specified decimals are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler, String, String)

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double, String, Object[])

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double, String, String, String)

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double, String)

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(Double, Double, Double)

Tests whether the specified doubles are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler, String, String)

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64, String, Object[])

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64, String, String, String)

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64, String)

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(Int64, Int64, Int64)

Tests whether the specified longs are unequal and throws an exception if they are equal.

AreNotEqual(Object, Object, String, Object[])

Tests whether the specified objects are unequal and throws an exception if the two objects are equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

AreNotEqual(Object, Object, String)

Tests whether the specified objects are unequal and throws an exception if the two objects are equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

AreNotEqual(Object, Object)

Tests whether the specified objects are unequal and throws an exception if the two objects are equal. Different numeric types are treated as unequal even if the logical values are equal. 42L is not equal to 42.

AreNotEqual(Single, Single, Single, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler, String, String)

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(Single, Single, Single, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(Single, Single, Single, String, Object[])

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(Single, Single, Single, String, String, String)

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(Single, Single, Single, String)

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(Single, Single, Single)

Tests whether the specified floats are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler, String, String)

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual(String, String, Boolean, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual(String, String, Boolean, CultureInfo, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler, String, String)

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, CultureInfo, Assert+AssertNonGenericAreNotEqualInterpolatedStringHandler)

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, CultureInfo, String, Object[])

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, CultureInfo, String, String, String)

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, CultureInfo, String)

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, CultureInfo)

Tests whether the specified strings are unequal and throws an exception if they are equal.

AreNotEqual(String, String, Boolean, String, Object[])

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual(String, String, Boolean, String, String, String)

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual(String, String, Boolean, String)

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual(String, String, Boolean)

Tests whether the specified strings are unequal and throws an exception if they are equal. The invariant culture is used for the comparison.

AreNotEqual<T>(T, T, Assert.AssertAreNotEqualInterpolatedStringHandler<T>, String, String)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, Assert.AssertAreNotEqualInterpolatedStringHandler<T>)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, IEqualityComparer<T>, Assert.AssertAreNotEqualInterpolatedStringHandler<T>, String, String)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, IEqualityComparer<T>, Assert.AssertAreNotEqualInterpolatedStringHandler<T>)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, IEqualityComparer<T>, String, Object[])

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

AreNotEqual<T>(T, T, IEqualityComparer<T>, String, String, String)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

AreNotEqual<T>(T, T, IEqualityComparer<T>, String)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

AreNotEqual<T>(T, T, IEqualityComparer<T>)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the provided comparer parameter.

AreNotEqual<T>(T, T, String, Object[])

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, String, String, String)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T, String)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEqual<T>(T, T)

Tests whether the specified values are unequal and throws an exception if the two values are equal. The equality is computed using the default EqualityComparer<T>.

AreNotEquivalent<T>(T, T, Boolean, String, String, String)

Tests whether two object graphs are NOT structurally equivalent and throws an exception if they are.

AreNotEquivalent<T>(T, T, String, String, String)

Tests whether two object graphs are NOT structurally equivalent and throws an exception if they are.

AreNotSame(Object, Object, String, Object[])

Tests whether the specified objects refer to different objects and throws an exception if the two inputs refer to the same object.

AreNotSame(Object, Object, String)

Tests whether the specified objects refer to different objects and throws an exception if the two inputs refer to the same object.

AreNotSame(Object, Object)

Tests whether the specified objects refer to different objects and throws an exception if the two inputs refer to the same object.

AreNotSame<T>(T, T, Assert.AssertAreNotSameInterpolatedStringHandler<T>, String, String)

Tests whether the specified objects refer to different objects and throws an exception if the two inputs refer to the same object.

AreNotSame<T>(T, T, Assert.AssertAreNotSameInterpolatedStringHandler<T>)

Tests whether the specified objects refer to different objects and throws an exception if the two inputs refer to the same object.

AreNotSame<T>(T, T, String, Object[])

Tests whether the specified objects refer to different objects and throws an exception if the two inputs refer to the same object.

AreNotSame<T>(T, T, String, String, String)

Tests whether the specified objects refer to different objects and throws an exception if the two inputs refer to the same object.

AreNotSame<T>(T, T, String)

Tests whether the specified objects refer to different objects and throws an exception if the two inputs refer to the same object.

AreNotSame<T>(T, T)

Tests whether the specified objects refer to different objects and throws an exception if the two inputs refer to the same object.

AreNotSequenceEqual(IEnumerable, IEnumerable, IEqualityComparer, SequenceOrder, String, String, String)

Tests whether two sequences differ using the specified comparer and order semantics and throws an exception if they do not.

AreNotSequenceEqual(IEnumerable, IEnumerable, IEqualityComparer, String, String, String)

Tests whether two sequences differ in the same order using the specified comparer and throws an exception if they do not.

AreNotSequenceEqual(IEnumerable, IEnumerable, SequenceOrder, String, String, String)

Tests whether two sequences differ using the specified order semantics and throws an exception if they do not.

AreNotSequenceEqual(IEnumerable, IEnumerable, String, String, String)

Tests whether two sequences differ in the same order and throws an exception if they do not.

AreNotSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, SequenceOrder, String, String, String)

Tests whether two sequences differ using the specified comparer and order semantics and throws an exception if they do not.

AreNotSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String, String, String)

Tests whether two sequences differ in the same order using the specified comparer and throws an exception if they do not.

AreNotSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, SequenceOrder, String, String, String)

Tests whether two sequences differ using the specified order semantics and throws an exception if they do not.

AreNotSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, String, String, String)

Tests whether two sequences differ in the same order and throws an exception if they do not.

AreSame(Object, Object, String, Object[])

Tests whether the specified objects both refer to the same object and throws an exception if the two inputs do not refer to the same object.

AreSame(Object, Object, String)

Tests whether the specified objects both refer to the same object and throws an exception if the two inputs do not refer to the same object.

AreSame(Object, Object)

Tests whether the specified objects both refer to the same object and throws an exception if the two inputs do not refer to the same object.

AreSame<T>(T, T, Assert.AssertAreSameInterpolatedStringHandler<T>, String, String)

Tests whether the specified objects both refer to the same object and throws an exception if the two inputs do not refer to the same object.

AreSame<T>(T, T, Assert.AssertAreSameInterpolatedStringHandler<T>)

Tests whether the specified objects both refer to the same object and throws an exception if the two inputs do not refer to the same object.

AreSame<T>(T, T, String, Object[])

Tests whether the specified objects both refer to the same object and throws an exception if the two inputs do not refer to the same object.

AreSame<T>(T, T, String, String, String)

Tests whether the specified objects both refer to the same object and throws an exception if the two inputs do not refer to the same object.

AreSame<T>(T, T, String)

Tests whether the specified objects both refer to the same object and throws an exception if the two inputs do not refer to the same object.

AreSame<T>(T, T)

Tests whether the specified objects both refer to the same object and throws an exception if the two inputs do not refer to the same object.

AreSequenceEqual(IEnumerable, IEnumerable, IEqualityComparer, SequenceOrder, String, String, String)

Tests whether two sequences contain equal elements using the specified comparer and order semantics and throws an exception if they do not.

AreSequenceEqual(IEnumerable, IEnumerable, IEqualityComparer, String, String, String)

Tests whether two sequences contain equal elements in the same order using the specified comparer and throws an exception if they do not.

AreSequenceEqual(IEnumerable, IEnumerable, SequenceOrder, String, String, String)

Tests whether two sequences contain equal elements using the specified order semantics and throws an exception if they do not.

AreSequenceEqual(IEnumerable, IEnumerable, String, String, String)

Tests whether two sequences contain equal elements in the same order and throws an exception if they do not.

AreSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, SequenceOrder, String, String, String)

Tests whether two sequences contain equal elements using the specified comparer and order semantics and throws an exception if they do not.

AreSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String, String, String)

Tests whether two sequences contain equal elements in the same order using the specified comparer and throws an exception if they do not.

AreSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, SequenceOrder, String, String, String)

Tests whether two sequences contain equal elements using the specified order semantics and throws an exception if they do not.

AreSequenceEqual<T>(IEnumerable<T>, IEnumerable<T>, String, String, String)

Tests whether two sequences contain equal elements in the same order and throws an exception if they do not.

Contains(Func<Object,Boolean>, IEnumerable, String, String, String)

Tests whether the specified collection contains the given element.

Contains(Func<Object,Boolean>, IEnumerable, String)

Tests whether the specified collection contains the given element.

Contains(Func<Object,Boolean>, IEnumerable)

Tests whether the specified collection contains the given element.

Contains(Object, IEnumerable, IEqualityComparer, String, String, String)

Tests whether the specified collection contains the given element.

Contains(Object, IEnumerable, IEqualityComparer, String)

Tests whether the specified collection contains the given element.

Contains(Object, IEnumerable, IEqualityComparer)

Tests whether the specified collection contains the given element.

Contains(Object, IEnumerable, String, String, String)

Tests whether the specified collection contains the given element.

Contains(Object, IEnumerable, String)

Tests whether the specified collection contains the given element.

Contains(Object, IEnumerable)

Tests whether the specified non-generic collection contains the given element.

Contains(String, String, String, Object[])

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains(String, String, String, String, String)

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains(String, String, String)

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains(String, String, StringComparison, String, Object[])

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains(String, String, StringComparison, String, String, String)

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains(String, String, StringComparison, String)

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains(String, String, StringComparison)

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains(String, String)

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur within the test string.

Contains<T>(Func<T,Boolean>, IEnumerable<T>, String, Object[])

Tests whether the specified collection contains the given element.

Contains<T>(Func<T,Boolean>, IEnumerable<T>, String, String, String)

Tests whether the specified collection contains the given element.

Contains<T>(Func<T,Boolean>, IEnumerable<T>, String)

Tests whether the specified collection contains the given element.

Contains<T>(Func<T,Boolean>, IEnumerable<T>)

Tests whether the specified collection contains the given element.

Contains<T>(IEnumerable<T>, Func<T,Boolean>, String)

Tests whether the specified collection contains the given element.

Contains<T>(T, IEnumerable<T>, IEqualityComparer<T>, String, Object[])

Tests whether the specified collection contains the given element.

Contains<T>(T, IEnumerable<T>, IEqualityComparer<T>, String, String, String)

Tests whether the specified collection contains the given element.

Contains<T>(T, IEnumerable<T>, IEqualityComparer<T>, String)

Tests whether the specified collection contains the given element.

Contains<T>(T, IEnumerable<T>, IEqualityComparer<T>)

Tests whether the specified collection contains the given element.

Contains<T>(T, IEnumerable<T>, String, Object[])

Tests whether the specified collection contains the given element.

Contains<T>(T, IEnumerable<T>, String, String, String)

Tests whether the specified collection contains the given element.

Contains<T>(T, IEnumerable<T>, String)

Tests whether the specified collection contains the given element.

Contains<T>(T, IEnumerable<T>)

Tests whether the specified collection contains the given element.

ContainsAll(IEnumerable, IEnumerable, IEqualityComparer, String, String, String)

Tests whether collection contains every element of expected (with multiplicity) and throws an exception if any element in expected occurs more times than in collection.

ContainsAll(IEnumerable, IEnumerable, String, String, String)

Tests whether collection contains every element of expected (with multiplicity) and throws an exception if any element in expected occurs more times than in collection.

ContainsAll<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String, String, String)

Tests whether collection contains every element of expected (with multiplicity) and throws an exception if any element in expected occurs more times than in collection.

ContainsAll<T>(IEnumerable<T>, IEnumerable<T>, String, String, String)

Tests whether collection contains every element of expected (with multiplicity) and throws an exception if any element in expected occurs more times than in collection.

ContainsSingle(Func<Object,Boolean>, IEnumerable, String, String, String)

Tests whether the specified collection contains exactly one element that matches the given predicate.

ContainsSingle(IEnumerable, String, String)

Tests whether the specified collection contains exactly one element.

ContainsSingle<T>(Func<T,Boolean>, IEnumerable<T>, String, String, String)

Tests whether the specified collection contains exactly one element that matches the given predicate.

ContainsSingle<T>(Func<T,Boolean>, IEnumerable<T>, String)

Tests whether the specified collection contains exactly one element that matches the given predicate.

ContainsSingle<T>(IEnumerable<T>, Assert.AssertSingleInterpolatedStringHandler<T>, String)

Tests whether the specified collection contains exactly one element.

ContainsSingle<T>(IEnumerable<T>, Assert.AssertSingleInterpolatedStringHandler<T>)

Tests whether the specified collection contains exactly one element.

ContainsSingle<T>(IEnumerable<T>, String, Object[])

Tests whether the specified collection contains exactly one element.

ContainsSingle<T>(IEnumerable<T>, String, String)

Tests whether the specified collection contains exactly one element.

ContainsSingle<T>(IEnumerable<T>, String)

Tests whether the specified collection contains exactly one element.

ContainsSingle<T>(IEnumerable<T>)

Tests whether the specified collection contains exactly one element.

DoesNotContain(Func<Object,Boolean>, IEnumerable, String, String, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain(Func<Object,Boolean>, IEnumerable, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain(Func<Object,Boolean>, IEnumerable)

Tests whether the specified collection does not contain the specified item.

DoesNotContain(Object, IEnumerable, IEqualityComparer, String, String, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain(Object, IEnumerable, IEqualityComparer, String)

Tests whether the specified non-generic collection does not contain the specified item, using a custom equality comparer.

DoesNotContain(Object, IEnumerable, IEqualityComparer)

Tests whether the specified collection does not contain the specified item.

DoesNotContain(Object, IEnumerable, String, String, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain(Object, IEnumerable, String)

Tests whether the specified non-generic collection does not contain the specified item.

DoesNotContain(Object, IEnumerable)

Tests whether the specified non-generic collection does not contain the specified item.

DoesNotContain(String, String, String, Object[])

Tests whether the specified string does not contain the specified substring and throws an exception if the substring occurs within the test string.

DoesNotContain(String, String, String, String, String)

Tests whether the specified string does not contain the specified substring and throws an exception if the substring occurs within the test string.

DoesNotContain(String, String, String)

Tests whether the specified string does not contain the specified substring and throws an exception if the substring occurs within the test string.

DoesNotContain(String, String, StringComparison, String, Object[])

Tests whether the specified string does not contain the specified substring and throws an exception if the substring occurs within the test string.

DoesNotContain(String, String, StringComparison, String, String, String)

Tests whether the specified string does not contain the specified substring and throws an exception if the substring occurs within the test string.

DoesNotContain(String, String, StringComparison, String)

Tests whether the specified string does not contain the specified substring and throws an exception if the substring occurs within the test string.

DoesNotContain(String, String, StringComparison)

Tests whether the specified string does not contain the specified substring and throws an exception if the substring occurs within the test string.

DoesNotContain(String, String)

Tests whether the specified string does not contain the specified substring and throws an exception if the substring occurs within the test string.

DoesNotContain<T>(Func<T,Boolean>, IEnumerable<T>, String, Object[])

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(Func<T,Boolean>, IEnumerable<T>, String, String, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(Func<T,Boolean>, IEnumerable<T>, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(Func<T,Boolean>, IEnumerable<T>)

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(T, IEnumerable<T>, IEqualityComparer<T>, String, Object[])

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(T, IEnumerable<T>, IEqualityComparer<T>, String, String, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(T, IEnumerable<T>, IEqualityComparer<T>, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(T, IEnumerable<T>, IEqualityComparer<T>)

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(T, IEnumerable<T>, String, Object[])

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(T, IEnumerable<T>, String, String, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(T, IEnumerable<T>, String)

Tests whether the specified collection does not contain the specified item.

DoesNotContain<T>(T, IEnumerable<T>)

Tests whether the specified collection does not contain the specified item.

DoesNotContainAll(IEnumerable, IEnumerable, IEqualityComparer, String, String, String)

Tests whether collection does not contain every element of notExpected (with multiplicity) and throws an exception if every element in notExpected occurs at least as many times in collection.

DoesNotContainAll(IEnumerable, IEnumerable, String, String, String)

Tests whether collection does not contain every element of notExpected (with multiplicity) and throws an exception if every element in notExpected occurs at least as many times in collection.

DoesNotContainAll<T>(IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>, String, String, String)

Tests whether collection does not contain every element of notExpected (with multiplicity) and throws an exception if every element in notExpected occurs at least as many times in collection.

DoesNotContainAll<T>(IEnumerable<T>, IEnumerable<T>, String, String, String)

Tests whether collection does not contain every element of notExpected (with multiplicity) and throws an exception if every element in notExpected occurs at least as many times in collection.

DoesNotEndWith(String, String, String, String, String)

Tests whether the specified string does not end with the specified unexpected suffix and throws an exception if the test string ends with the suffix.

DoesNotEndWith(String, String, String)

Tests whether the specified string does not end with the specified substring and throws an exception if the test string does not end with the substring.

DoesNotEndWith(String, String, StringComparison, String, String, String)

Tests whether the specified string does not end with the specified unexpected suffix and throws an exception if the test string does ends with the suffix.

DoesNotEndWith(String, String, StringComparison, String)

Tests whether the specified string does not end with the specified substring and throws an exception if the test string does not end with the substring.

DoesNotMatchRegex(Regex, String, String, String, String)

Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.

DoesNotMatchRegex(Regex, String, String)

Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.

DoesNotMatchRegex(String, String, String, String, String)

Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.

DoesNotMatchRegex(String, String, String)

Tests whether the specified string does not match a regular expression and throws an exception if the string MatchesRegex the expression.

DoesNotStartWith(String, String, String, String, String)

Tests whether the specified string does not begin with the specified unexpected prefix and throws an exception if the test string does start with the prefix.

DoesNotStartWith(String, String, String)

Tests whether the specified string does not begin with the specified substring and throws an exception if the test string does start with the substring.

DoesNotStartWith(String, String, StringComparison, String, String, String)

Tests whether the specified string does not begin with the specified unexpected prefix and throws an exception if the test string does start with the prefix.

DoesNotStartWith(String, String, StringComparison, String)

Tests whether the specified string does not begin with the specified substring and throws an exception if the test string does start with the substring.

EndsWith(String, String, String, String, String)

Tests whether the specified string ends with the specified suffix and throws an exception if the test string does not end with the suffix.

EndsWith(String, String, String)

Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring.

EndsWith(String, String, StringComparison, String, String, String)

Tests whether the specified string ends with the specified suffix and throws an exception if the test string does not end with the suffix.

EndsWith(String, String, StringComparison, String)

Tests whether the specified string ends with the specified substring and throws an exception if the test string does not end with the substring.

Equals(Object, Object)
Obsolete.
Obsolete.

Static equals overloads are used for comparing instances of two types for reference equality. This method should not be used for comparison of two instances for equality. Please use Assert.AreEqual and associated overloads in your unit tests.

Fail()

Throws an AssertFailedException.

Fail(String, Object[])

Throws an AssertFailedException.

Fail(String)

Throws an AssertFailedException.

HasCount(Int32, IEnumerable, String, String)

Tests whether the collection has the expected count/length.

HasCount(Int32, IEnumerable, String)

Tests whether the collection has the expected count/length.

HasCount(Int32, IEnumerable)

Tests whether the collection has the expected count/length.

HasCount<T>(Int32, IEnumerable<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)

Tests whether the collection has the expected count/length.

HasCount<T>(Int32, IEnumerable<T>, Assert.AssertCountInterpolatedStringHandler<T>)

Tests whether the collection has the expected count/length.

HasCount<T>(Int32, IEnumerable<T>, String, Object[])

Tests whether the collection has the expected count/length.

HasCount<T>(Int32, IEnumerable<T>, String, String)

Tests whether the collection has the expected count/length.

HasCount<T>(Int32, IEnumerable<T>, String)

Tests whether the collection has the expected count/length.

HasCount<T>(Int32, IEnumerable<T>)

Tests whether the collection has the expected count/length.

HasCount<T>(Int32, Memory<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)

Tests whether the memory has the expected count/length.

HasCount<T>(Int32, Memory<T>, String, String)

Tests whether the memory has the expected count/length.

HasCount<T>(Int32, ReadOnlyMemory<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)

Tests whether the memory has the expected count/length.

HasCount<T>(Int32, ReadOnlyMemory<T>, String, String)

Tests whether the memory has the expected count/length.

HasCount<T>(Int32, ReadOnlySpan<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)

Tests whether the span has the expected count/length.

HasCount<T>(Int32, ReadOnlySpan<T>, String, String)

Tests whether the span has the expected count/length.

HasCount<T>(Int32, Span<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)

Tests whether the span has the expected count/length.

HasCount<T>(Int32, Span<T>, String, String)

Tests whether the span has the expected count/length.

Inconclusive()

Throws an AssertInconclusiveException.

Inconclusive(String, Object[])

Throws an AssertInconclusiveException.

Inconclusive(String)

Throws an AssertInconclusiveException.

IsEmpty(IEnumerable, String, String)

Tests that the collection is empty.

IsEmpty(IEnumerable, String)

Tests that the collection is empty.

IsEmpty(IEnumerable)

Tests that the collection is empty.

IsEmpty<T>(IEnumerable<T>, Assert.AssertCountInterpolatedStringHandler<T>, String)

Tests that the collection is empty.

IsEmpty<T>(IEnumerable<T>, Assert.AssertCountInterpolatedStringHandler<T>)

Tests that the collection is empty.

IsEmpty<T>(IEnumerable<T>, String, Object[])

Tests that the collection is empty.

IsEmpty<T>(IEnumerable<T>, String, String)

Tests that the collection is empty.

IsEmpty<T>(IEnumerable<T>, String)

Tests that the collection is empty.

IsEmpty<T>(IEnumerable<T>)

Tests that the collection is empty.

IsExactInstanceOfType(Object, Type, Assert+AssertIsExactInstanceOfTypeInterpolatedStringHandler, String)

Tests whether the specified object is exactly an instance of the expected type and throws an exception if the expected type does not match exactly.

IsExactInstanceOfType(Object, Type, String, String)

Tests whether the specified object is exactly an instance of the expected type and throws an exception if the expected type does not match exactly.

IsExactInstanceOfType<T>(Object, Assert.AssertGenericIsExactInstanceOfTypeInterpolatedStringHandler<T>, String)

Tests whether the specified object is exactly an instance of the generic type and throws an exception if the generic type does not match exactly.

IsExactInstanceOfType<T>(Object, String, String)

Tests whether the specified object is exactly an instance of the generic type and throws an exception if the generic type does not match exactly.

IsFalse(Boolean, Assert+AssertIsFalseInterpolatedStringHandler)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Boolean, String, Object[])

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Boolean, String)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Boolean)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, Assert+AssertIsFalseInterpolatedStringHandler, String)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, Assert+AssertIsFalseInterpolatedStringHandler)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, String, Object[])

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, String, String)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>, String)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsFalse(Nullable<Boolean>)

Tests whether the specified condition is false and throws an exception if the condition is true.

IsGreaterThan<T>(T, T, String, String, String)

Tests whether the value is greater than the lower bound and throws an exception if it is not.

IsGreaterThan<T>(T, T, String)

Tests whether the value is greater than the lower bound and throws an exception if it is not.

IsGreaterThanOrEqualTo<T>(T, T, String, String, String)

Tests whether the value is greater than or equal to the lower bound and throws an exception if it is not.

IsGreaterThanOrEqualTo<T>(T, T, String)

Tests whether the value is greater than or equal to the lower bound and throws an exception if it is not.

IsInRange<T>(T, T, T, String, String, String, String)

Tests whether the specified value is within the expected range (inclusive). The range includes both the minimum and maximum values.

IsInRange<T>(T, T, T, String)

Tests whether the specified value is within the expected range (inclusive). The range includes both the minimum and maximum values.

IsInstanceOfType(Object, Type, Assert+AssertIsInstanceOfTypeInterpolatedStringHandler, String)

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

IsInstanceOfType(Object, Type, Assert+AssertIsInstanceOfTypeInterpolatedStringHandler)

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

IsInstanceOfType(Object, Type, String, Object[])

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

IsInstanceOfType(Object, Type, String, String)

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

IsInstanceOfType(Object, Type, String)

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

IsInstanceOfType(Object, Type)

Tests whether the specified object is an instance of the expected type and throws an exception if the expected type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object, Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T>, String)

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object, Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T>)

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object, String, Object[])

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object, String, String)

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object, String)

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object, T, Assert.AssertGenericIsInstanceOfTypeInterpolatedStringHandler<T>)

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object, T, String, Object[])

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object, T, String)

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object, T)

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsInstanceOfType<T>(Object)

Tests whether the specified object is an instance of the generic type and throws an exception if the generic type is not in the inheritance hierarchy of the object.

IsLessThan<T>(T, T, String, String, String)

Tests whether the value is less than the upper bound and throws an exception if it is not.

IsLessThan<T>(T, T, String)

Tests whether the value is less than the upper bound and throws an exception if it is not.

IsLessThanOrEqualTo<T>(T, T, String, String, String)

Tests whether the value is less than or equal to the upper bound and throws an exception if it is not.

IsLessThanOrEqualTo<T>(T, T, String)

Tests whether the value is less than or equal to the upper bound and throws an exception if it is not.

IsNegative<T>(T, String, String)

Tests whether the specified value is negative and throws an exception if it is not.

IsNegative<T>(T, String)

Tests whether the specified value is negative and throws an exception if it is not.

IsNotEmpty(IEnumerable, String, String)

Tests that the collection is not empty.

IsNotEmpty(IEnumerable, String)

Tests that the collection is not empty.

IsNotEmpty(IEnumerable)

Tests that the collection is not empty.

IsNotEmpty<T>(IEnumerable<T>, Assert.AssertIsNotEmptyInterpolatedStringHandler<T>, String)

Tests that the collection is not empty.

IsNotEmpty<T>(IEnumerable<T>, Assert.AssertIsNotEmptyInterpolatedStringHandler<T>)

Tests that the collection is not empty.

IsNotEmpty<T>(IEnumerable<T>, String, Object[])

Tests that the collection is not empty.

IsNotEmpty<T>(IEnumerable<T>, String, String)

Tests that the collection is not empty.

IsNotEmpty<T>(IEnumerable<T>, String)

Tests whether the collection is not empty.

IsNotEmpty<T>(IEnumerable<T>)

Tests that the collection is not empty.

IsNotExactInstanceOfType(Object, Type, Assert+AssertIsNotExactInstanceOfTypeInterpolatedStringHandler, String)

Tests whether the specified object is not exactly an instance of the wrong type and throws an exception if the specified type matches exactly.

IsNotExactInstanceOfType(Object, Type, String, String)

Tests whether the specified object is not exactly an instance of the wrong type and throws an exception if the specified type matches exactly.

IsNotExactInstanceOfType<T>(Object, Assert.AssertGenericIsNotExactInstanceOfTypeInterpolatedStringHandler<T>, String)

Tests whether the specified object is not exactly an instance of the wrong generic type and throws an exception if the specified type matches exactly.

IsNotExactInstanceOfType<T>(Object, String, String)

Tests whether the specified object is not exactly an instance of the wrong generic type and throws an exception if the specified type matches exactly.

IsNotInstanceOfType(Object, Type, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler, String)

Tests whether the specified object is not an instance of the wrong type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType(Object, Type, Assert+AssertIsNotInstanceOfTypeInterpolatedStringHandler)

Tests whether the specified object is not an instance of the wrong type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType(Object, Type, String, Object[])

Tests whether the specified object is not an instance of the wrong type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType(Object, Type, String, String)

Tests whether the specified object is not an instance of the wrong type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType(Object, Type, String)

Tests whether the specified object is not an instance of the wrong type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType(Object, Type)

Tests whether the specified object is not an instance of the wrong type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>, String)

Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType<T>(Object, Assert.AssertGenericIsNotInstanceOfTypeInterpolatedStringHandler<T>)

Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType<T>(Object, String, Object[])

Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType<T>(Object, String, String)

Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType<T>(Object, String)

Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotInstanceOfType<T>(Object)

Tests whether the specified object is not an instance of the wrong generic type and throws an exception if the specified type is in the inheritance hierarchy of the object.

IsNotNull(Object, Assert+AssertIsNotNullInterpolatedStringHandler, String)

Tests whether the specified object is null and throws an exception if it is not.

IsNotNull(Object, Assert+AssertIsNotNullInterpolatedStringHandler)

Tests whether the specified object is null and throws an exception if it is not.

IsNotNull(Object, String, Object[])

Tests whether the specified object is non-null and throws an exception if it is null.

IsNotNull(Object, String, String)

Tests whether the specified object is non-null and throws an exception if it is null.

IsNotNull(Object, String)

Tests whether the specified object is non-null and throws an exception if it is null.

IsNotNull(Object)

Tests whether the specified object is non-null and throws an exception if it is null.

IsNull(Object, Assert+AssertIsNullInterpolatedStringHandler, String)

Tests whether the specified object is null and throws an exception if it is not.

IsNull(Object, Assert+AssertIsNullInterpolatedStringHandler)

Tests whether the specified object is null and throws an exception if it is not.

IsNull(Object, String, Object[])

Tests whether the specified object is null and throws an exception if it is not.

IsNull(Object, String, String)

Tests whether the specified object is null and throws an exception if it is not.

IsNull(Object, String)

Tests whether the specified object is null and throws an exception if it is not.

IsNull(Object)

Tests whether the specified object is null and throws an exception if it is not.

IsPositive<T>(T, String, String)

Tests whether the specified value is positive and throws an exception if it is not.

IsPositive<T>(T, String)

Tests whether the specified value is positive and throws an exception if it is not.

IsTrue(Boolean, Assert+AssertIsTrueInterpolatedStringHandler)

Tests whether the specified condition is true and throws an exception if the condition is false.

IsTrue(Boolean, String, Object[])

Tests whether the specified condition is true and throws an exception if the condition is false.

IsTrue(Boolean, String)

Tests whether the specified condition is true and throws an exception if the condition is false.

IsTrue(Boolean)

Tests whether the specified condition is true and throws an exception if the condition is false.

IsTrue(Nullable<Boolean>, Assert+AssertIsTrueInterpolatedStringHandler, String)

Tests whether the specified condition is true and throws an exception if the condition is false.

IsTrue(Nullable<Boolean>, Assert+AssertIsTrueInterpolatedStringHandler)

Tests whether the specified condition is true and throws an exception if the condition is false.

IsTrue(Nullable<Boolean>, String, Object[])

Tests whether the specified condition is true and throws an exception if the condition is false.

IsTrue(Nullable<Boolean>, String, String)

Tests whether the specified condition is true and throws an exception if the condition is false.

IsTrue(Nullable<Boolean>, String)

Tests whether the specified condition is true and throws an exception if the condition is false.

IsTrue(Nullable<Boolean>)

Tests whether the specified condition is true and throws an exception if the condition is false.

MatchesRegex(Regex, String, String, String, String)

Tests whether the specified string MatchesRegex a regular expression and throws an exception if the string does not match the expression.

MatchesRegex(Regex, String, String)

Tests whether the specified string MatchesRegex a regular expression and throws an exception if the string does not match the expression.

MatchesRegex(String, String, String, String, String)

Tests whether the specified string MatchesRegex a regular expression and throws an exception if the string does not match the expression.

MatchesRegex(String, String, String)

Tests whether the specified string MatchesRegex a regular expression and throws an exception if the string does not match the expression.

ReferenceEquals(Object, Object)
Obsolete.
Obsolete.

Static ReferenceEquals overloads are used for comparing instances of two types for reference equality. This method should not be used for comparison of two instances for reference equality. Please use Assert.AreSame and associated overloads in your unit tests.

ReplaceNullChars(String)

Replaces null characters ('\0') with "\0".

Scope()

Creates a new assertion scope that collects assertion failures instead of throwing them immediately. When the returned scope is disposed, all collected failures are thrown as a single AssertFailedException.

StartsWith(String, String, String, String, String)

Tests whether the specified string begins with the specified prefix and throws an exception if the test string does not start with the prefix.

StartsWith(String, String, String)

Tests whether the specified string begins with the specified substring and throws an exception if the test string does not start with the substring.

StartsWith(String, String, StringComparison, String, String, String)

Tests whether the specified string begins with the specified prefix and throws an exception if the test string does not start with the prefix.

StartsWith(String, String, StringComparison, String)

Tests whether the specified string begins with the specified substring and throws an exception if the test string does not start with the substring.

Throws<TException>(Action, Assert.AssertNonStrictThrowsInterpolatedStringHandler<TException>, String)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

Throws<TException>(Action, Assert.AssertNonStrictThrowsInterpolatedStringHandler<TException>)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

Throws<TException>(Action, Func<Exception,String>, String)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

Throws<TException>(Action, Func<Exception,String>)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

Throws<TException>(Action, String, Object[])

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

Throws<TException>(Action, String, String)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

Throws<TException>(Func<Object>, Assert.AssertNonStrictThrowsInterpolatedStringHandler<TException>, String)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

Throws<TException>(Func<Object>, Assert.AssertNonStrictThrowsInterpolatedStringHandler<TException>)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

Throws<TException>(Func<Object>, Func<Exception,String>, String)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

Throws<TException>(Func<Object>, Func<Exception,String>)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

Throws<TException>(Func<Object>, String, Object[])

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

Throws<TException>(Func<Object>, String, String)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsAsync<TException>(Func<Task>, Assert.AssertNonStrictThrowsAsyncInterpolatedStringHandler<TException>, String)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsAsync<TException>(Func<Task>, Func<Exception,String>, String)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsAsync<TException>(Func<Task>, Func<Exception,String>)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsAsync<TException>(Func<Task>, String, Object[])

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsAsync<TException>(Func<Task>, String, String)

Asserts that the delegate action throws an exception of type TException (or derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsExactly<TException>(Action, Assert.AssertThrowsExactlyInterpolatedStringHandler<TException>, String)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsExactly<TException>(Action, Assert.AssertThrowsExactlyInterpolatedStringHandler<TException>)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsExactly<TException>(Action, Func<Exception,String>, String)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsExactly<TException>(Action, Func<Exception,String>)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsExactly<TException>(Action, String, Object[])

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsExactly<TException>(Action, String, String)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsExactly<TException>(Func<Object>, Assert.AssertThrowsExactlyInterpolatedStringHandler<TException>, String)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsExactly<TException>(Func<Object>, Assert.AssertThrowsExactlyInterpolatedStringHandler<TException>)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsExactly<TException>(Func<Object>, Func<Exception,String>, String)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsExactly<TException>(Func<Object>, Func<Exception,String>)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsExactly<TException>(Func<Object>, String, Object[])

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsExactly<TException>(Func<Object>, String, String)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsExactlyAsync<TException>(Func<Task>, Assert.AssertThrowsExactlyAsyncInterpolatedStringHandler<TException>, String)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsExactlyAsync<TException>(Func<Task>, Func<Exception,String>, String)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsExactlyAsync<TException>(Func<Task>, Func<Exception,String>)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsExactlyAsync<TException>(Func<Task>, String, Object[])

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than TException.

ThrowsExactlyAsync<TException>(Func<Task>, String, String)

Asserts that the delegate action throws an exception of type TException (and not of derived type) and throws AssertFailedException if code does not throw exception or throws exception of type other than TException.

ThrowsException<T>(Action, String, Object[])

Tests whether the code specified by delegate action throws exact given exception of type T (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than T.

ThrowsException<T>(Action, String)

Tests whether the code specified by delegate action throws exact given exception of type T (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than T.

ThrowsException<T>(Action)

Tests whether the code specified by delegate action throws exact given exception of type T (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than T.

ThrowsException<T>(Func<Object>, String, Object[])

Tests whether the code specified by delegate action throws exact given exception of type T (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than T.

ThrowsException<T>(Func<Object>, String)

Tests whether the code specified by delegate action throws exact given exception of type T (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than T.

ThrowsException<T>(Func<Object>)

Tests whether the code specified by delegate action throws exact given exception of type T (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than T.

ThrowsExceptionAsync<T>(Func<Task>, String, Object[])

Tests whether the code specified by delegate action throws exact given exception of type T (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than T.

ThrowsExceptionAsync<T>(Func<Task>, String)

Tests whether the code specified by delegate action throws exact given exception of type T (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than T.

ThrowsExceptionAsync<T>(Func<Task>)

Tests whether the code specified by delegate action throws exact given exception of type T (and not of derived type) and throws AssertFailedException if code does not throws exception or throws exception of type other than T.

Applies to