Share via


Assert.DoesNotContain Method

Definition

Overloads

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(Object, IEnumerable, IEqualityComparer, String, String, String)

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

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, 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(Object, IEnumerable, String, String, String)

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

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

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

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(Object, IEnumerable, IEqualityComparer, String)

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

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)

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

DoesNotContain(Object, IEnumerable, String)

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

DoesNotContain(Object, IEnumerable, IEqualityComparer)

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(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(Object, IEnumerable)

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

DoesNotContain(Func<Object,Boolean>, IEnumerable)

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

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<T>(T, IEnumerable<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>, String, String, String)

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>(Func<T,Boolean>, IEnumerable<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)

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>)

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

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)

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

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

Source:
Assert.Contains.cs

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

public static void DoesNotContain(string substring, string value, StringComparison comparisonType, string? message = "", string substringExpression = "", string valueExpression = "");
static member DoesNotContain : string * string * StringComparison * string * string * string -> unit
Public Shared Sub DoesNotContain (substring As String, value As String, comparisonType As StringComparison, Optional message As String = "", Optional substringExpression As String = "", Optional valueExpression As String = "")

Parameters

substring
String

The string expected to not occur within value.

value
String

The string that is expected to not contain substring.

comparisonType
StringComparison

The comparison method to compare strings comparisonType.

message
String

The message to include in the exception when substring is in value. The message is shown in test results.

substringExpression
String

The syntactic expression of substring as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

valueExpression
String

The syntactic expression of value as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Exceptions

value is null, or substring is null, or value contains substring.

Applies to

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

Source:
Assert.Contains.cs

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

public static void DoesNotContain(object? notExpected, System.Collections.IEnumerable collection, System.Collections.IEqualityComparer comparer, string? message = "", string notExpectedExpression = "", string collectionExpression = "");
static member DoesNotContain : obj * System.Collections.IEnumerable * System.Collections.IEqualityComparer * string * string * string -> unit
Public Shared Sub DoesNotContain (notExpected As Object, collection As IEnumerable, comparer As IEqualityComparer, Optional message As String = "", Optional notExpectedExpression As String = "", Optional collectionExpression As String = "")

Parameters

notExpected
Object

The unexpected item.

collection
IEnumerable

The collection.

comparer
IEqualityComparer

An equality comparer to compare values.

message
String

The message to display when the assertion fails.

notExpectedExpression
String

The syntactic expression of notExpected as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

collectionExpression
String

The syntactic expression of collection as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain(string substring, string value, StringComparison comparisonType, string? message, params object?[]? parameters);
static member DoesNotContain : string * string * StringComparison * string * obj[] -> unit
Public Shared Sub DoesNotContain (substring As String, value As String, comparisonType As StringComparison, message As String, ParamArray parameters As Object())

Parameters

substring
String

The string expected to not occur within value.

value
String

The string that is expected to not contain substring.

comparisonType
StringComparison

The comparison method to compare strings comparisonType.

message
String

The message to include in the exception when substring is in value. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

value is null, or substring is null, or value contains substring.

Applies to

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

Source:
Assert.Contains.cs

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

public static void DoesNotContain(string substring, string value, string? message = "", string substringExpression = "", string valueExpression = "");
static member DoesNotContain : string * string * string * string * string -> unit
Public Shared Sub DoesNotContain (substring As String, value As String, Optional message As String = "", Optional substringExpression As String = "", Optional valueExpression As String = "")

Parameters

substring
String

The string expected to not occur within value.

value
String

The string that is expected to not contain substring.

message
String

The message to include in the exception when substring is in value. The message is shown in test results.

substringExpression
String

The syntactic expression of substring as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

valueExpression
String

The syntactic expression of value as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Exceptions

value is null, or substring is null, or value contains substring.

Applies to

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

Source:
Assert.Contains.cs

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

public static void DoesNotContain(object? notExpected, System.Collections.IEnumerable collection, string? message = "", string notExpectedExpression = "", string collectionExpression = "");
static member DoesNotContain : obj * System.Collections.IEnumerable * string * string * string -> unit
Public Shared Sub DoesNotContain (notExpected As Object, collection As IEnumerable, Optional message As String = "", Optional notExpectedExpression As String = "", Optional collectionExpression As String = "")

Parameters

notExpected
Object

The unexpected item.

collection
IEnumerable

The collection.

message
String

The message to display when the assertion fails.

notExpectedExpression
String

The syntactic expression of notExpected as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

collectionExpression
String

The syntactic expression of collection as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Applies to

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

Source:
Assert.Contains.cs

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

public static void DoesNotContain(Func<object?,bool> predicate, System.Collections.IEnumerable collection, string? message = "", string predicateExpression = "", string collectionExpression = "");
static member DoesNotContain : Func<obj, bool> * System.Collections.IEnumerable * string * string * string -> unit
Public Shared Sub DoesNotContain (predicate As Func(Of Object, Boolean), collection As IEnumerable, Optional message As String = "", Optional predicateExpression As String = "", Optional collectionExpression As String = "")

Parameters

predicate
Func<Object,Boolean>

A function to test each element for a condition.

collection
IEnumerable

The collection.

message
String

The message to display when the assertion fails.

predicateExpression
String

The syntactic expression of predicate as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

collectionExpression
String

The syntactic expression of collection as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Applies to

DoesNotContain(String, String, StringComparison, String)

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain(string substring, string value, StringComparison comparisonType, string? message);
static member DoesNotContain : string * string * StringComparison * string -> unit
Public Shared Sub DoesNotContain (substring As String, value As String, comparisonType As StringComparison, message As String)

Parameters

substring
String

The string expected to not occur within value.

value
String

The string that is expected to not contain substring.

comparisonType
StringComparison

The comparison method to compare strings comparisonType.

message
String

The message to include in the exception when substring is in value. The message is shown in test results.

Exceptions

value is null, or substring is null, or value contains substring.

Applies to

DoesNotContain(Object, IEnumerable, IEqualityComparer, String)

Source:
Assert.Contains.cs

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

public static void DoesNotContain(object? expected, System.Collections.IEnumerable collection, System.Collections.IEqualityComparer comparer, string? message);
static member DoesNotContain : obj * System.Collections.IEnumerable * System.Collections.IEqualityComparer * string -> unit
Public Shared Sub DoesNotContain (expected As Object, collection As IEnumerable, comparer As IEqualityComparer, message As String)

Parameters

expected
Object

The expected item.

collection
IEnumerable

The non-generic collection.

comparer
IEqualityComparer

An equality comparer to compare values.

message
String

The message to display when the assertion fails.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain(string substring, string value, string? message, params object?[]? parameters);
static member DoesNotContain : string * string * string * obj[] -> unit
Public Shared Sub DoesNotContain (substring As String, value As String, message As String, ParamArray parameters As Object())

Parameters

substring
String

The string expected to not occur within value.

value
String

The string that is expected to not contain substring.

message
String

The message to include in the exception when substring is in value. The message is shown in test results.

parameters
Object[]

An array of parameters to use when formatting message.

Exceptions

value is null, or substring is null, or value contains substring.

Applies to

DoesNotContain(String, String, String)

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain(string substring, string value, string? message);
static member DoesNotContain : string * string * string -> unit
Public Shared Sub DoesNotContain (substring As String, value As String, message As String)

Parameters

substring
String

The string expected to not occur within value.

value
String

The string that is expected to not contain substring.

message
String

The message to include in the exception when substring is in value. The message is shown in test results.

Exceptions

value is null, or substring is null, or value contains substring.

Applies to

DoesNotContain(Object, IEnumerable, String)

Source:
Assert.Contains.cs

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

public static void DoesNotContain(object? expected, System.Collections.IEnumerable collection, string? message);
static member DoesNotContain : obj * System.Collections.IEnumerable * string -> unit
Public Shared Sub DoesNotContain (expected As Object, collection As IEnumerable, message As String)

Parameters

expected
Object

The expected item.

collection
IEnumerable

The non-generic collection.

message
String

The message to display when the assertion fails.

Applies to

DoesNotContain(Object, IEnumerable, IEqualityComparer)

Source:
Assert.Contains.cs

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

public static void DoesNotContain(object? expected, System.Collections.IEnumerable collection, System.Collections.IEqualityComparer comparer);
static member DoesNotContain : obj * System.Collections.IEnumerable * System.Collections.IEqualityComparer -> unit
Public Shared Sub DoesNotContain (expected As Object, collection As IEnumerable, comparer As IEqualityComparer)

Parameters

expected
Object

The expected item.

collection
IEnumerable

The collection.

comparer
IEqualityComparer

An equality comparer to compare values.

Applies to

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

Source:
Assert.Contains.cs

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

public static void DoesNotContain(Func<object?,bool> predicate, System.Collections.IEnumerable collection, string? message);
static member DoesNotContain : Func<obj, bool> * System.Collections.IEnumerable * string -> unit
Public Shared Sub DoesNotContain (predicate As Func(Of Object, Boolean), collection As IEnumerable, message As String)

Parameters

predicate
Func<Object,Boolean>

A function to test each element for a condition.

collection
IEnumerable

The collection.

message
String

The message to display when the assertion fails.

Applies to

DoesNotContain(String, String)

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain(string substring, string value);
static member DoesNotContain : string * string -> unit
Public Shared Sub DoesNotContain (substring As String, value As String)

Parameters

substring
String

The string expected to not occur within value.

value
String

The string that is expected to not contain substring.

Exceptions

value is null, or substring is null, or value contains substring.

Applies to

DoesNotContain(Object, IEnumerable)

Source:
Assert.Contains.cs

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

public static void DoesNotContain(object? expected, System.Collections.IEnumerable collection);
static member DoesNotContain : obj * System.Collections.IEnumerable -> unit
Public Shared Sub DoesNotContain (expected As Object, collection As IEnumerable)

Parameters

expected
Object

The expected item.

collection
IEnumerable

The non-generic collection.

Applies to

DoesNotContain(Func<Object,Boolean>, IEnumerable)

Source:
Assert.Contains.cs

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

public static void DoesNotContain(Func<object?,bool> predicate, System.Collections.IEnumerable collection);
static member DoesNotContain : Func<obj, bool> * System.Collections.IEnumerable -> unit
Public Shared Sub DoesNotContain (predicate As Func(Of Object, Boolean), collection As IEnumerable)

Parameters

predicate
Func<Object,Boolean>

A function to test each element for a condition.

collection
IEnumerable

The collection.

Applies to

DoesNotContain(String, String, StringComparison)

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain(string substring, string value, StringComparison comparisonType);
static member DoesNotContain : string * string * StringComparison -> unit
Public Shared Sub DoesNotContain (substring As String, value As String, comparisonType As StringComparison)

Parameters

substring
String

The string expected to not occur within value.

value
String

The string that is expected to not contain substring.

comparisonType
StringComparison

The comparison method to compare strings comparisonType.

Exceptions

value is null, or substring is null, or value contains substring.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(T expected, System.Collections.Generic.IEnumerable<T> collection, string? message, params object?[]? parameters);
static member DoesNotContain : 'T * seq<'T> * string * obj[] -> unit
Public Shared Sub DoesNotContain(Of T) (expected As T, collection As IEnumerable(Of T), message As String, ParamArray parameters As Object())

Type Parameters

T

The type of the collection items.

Parameters

expected
T

The expected item.

collection
IEnumerable<T>

The collection.

message
String

The message to display when the assertion fails.

parameters
Object[]

The parameters to format the message.

Applies to

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

Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(T notExpected, System.Collections.Generic.IEnumerable<T> collection, System.Collections.Generic.IEqualityComparer<T> comparer, string? message = "", string notExpectedExpression = "", string collectionExpression = "");
static member DoesNotContain : 'T * seq<'T> * System.Collections.Generic.IEqualityComparer<'T> * string * string * string -> unit
Public Shared Sub DoesNotContain(Of T) (notExpected As T, collection As IEnumerable(Of T), comparer As IEqualityComparer(Of T), Optional message As String = "", Optional notExpectedExpression As String = "", Optional collectionExpression As String = "")

Type Parameters

T

The type of the collection items.

Parameters

notExpected
T

The unexpected item.

collection
IEnumerable<T>

The collection.

comparer
IEqualityComparer<T>

An equality comparer to compare values.

message
String

The message to display when the assertion fails.

notExpectedExpression
String

The syntactic expression of notExpected as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

collectionExpression
String

The syntactic expression of collection as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Applies to

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

Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(T notExpected, System.Collections.Generic.IEnumerable<T> collection, string? message = "", string notExpectedExpression = "", string collectionExpression = "");
static member DoesNotContain : 'T * seq<'T> * string * string * string -> unit
Public Shared Sub DoesNotContain(Of T) (notExpected As T, collection As IEnumerable(Of T), Optional message As String = "", Optional notExpectedExpression As String = "", Optional collectionExpression As String = "")

Type Parameters

T

The type of the collection items.

Parameters

notExpected
T

The unexpected item.

collection
IEnumerable<T>

The collection.

message
String

The message to display when the assertion fails.

notExpectedExpression
String

The syntactic expression of notExpected as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

collectionExpression
String

The syntactic expression of collection as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(T expected, System.Collections.Generic.IEnumerable<T> collection, System.Collections.Generic.IEqualityComparer<T> comparer, string? message, params object?[]? parameters);
static member DoesNotContain : 'T * seq<'T> * System.Collections.Generic.IEqualityComparer<'T> * string * obj[] -> unit
Public Shared Sub DoesNotContain(Of T) (expected As T, collection As IEnumerable(Of T), comparer As IEqualityComparer(Of T), message As String, ParamArray parameters As Object())

Type Parameters

T

The type of the collection items.

Parameters

expected
T

The expected item.

collection
IEnumerable<T>

The collection.

comparer
IEqualityComparer<T>

An equality comparer to compare values.

message
String

The message to display when the assertion fails.

parameters
Object[]

The parameters to format the message.

Applies to

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

Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(Func<T,bool> predicate, System.Collections.Generic.IEnumerable<T> collection, string? message = "", string predicateExpression = "", string collectionExpression = "");
static member DoesNotContain : Func<'T, bool> * seq<'T> * string * string * string -> unit
Public Shared Sub DoesNotContain(Of T) (predicate As Func(Of T, Boolean), collection As IEnumerable(Of T), Optional message As String = "", Optional predicateExpression As String = "", Optional collectionExpression As String = "")

Type Parameters

T

The type of the collection items.

Parameters

predicate
Func<T,Boolean>

A function to test each element for a condition.

collection
IEnumerable<T>

The collection.

message
String

The message to display when the assertion fails.

predicateExpression
String

The syntactic expression of predicate as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

collectionExpression
String

The syntactic expression of collection as given by the compiler via caller argument expression. Users shouldn't pass a value for this parameter.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(T expected, System.Collections.Generic.IEnumerable<T> collection, System.Collections.Generic.IEqualityComparer<T> comparer, string? message);
static member DoesNotContain : 'T * seq<'T> * System.Collections.Generic.IEqualityComparer<'T> * string -> unit
Public Shared Sub DoesNotContain(Of T) (expected As T, collection As IEnumerable(Of T), comparer As IEqualityComparer(Of T), message As String)

Type Parameters

T

The type of the collection items.

Parameters

expected
T

The expected item.

collection
IEnumerable<T>

The collection.

comparer
IEqualityComparer<T>

An equality comparer to compare values.

message
String

The message to display when the assertion fails.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(T expected, System.Collections.Generic.IEnumerable<T> collection, System.Collections.Generic.IEqualityComparer<T> comparer);
static member DoesNotContain : 'T * seq<'T> * System.Collections.Generic.IEqualityComparer<'T> -> unit
Public Shared Sub DoesNotContain(Of T) (expected As T, collection As IEnumerable(Of T), comparer As IEqualityComparer(Of T))

Type Parameters

T

The type of the collection items.

Parameters

expected
T

The expected item.

collection
IEnumerable<T>

The collection.

comparer
IEqualityComparer<T>

An equality comparer to compare values.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(T expected, System.Collections.Generic.IEnumerable<T> collection, string? message);
static member DoesNotContain : 'T * seq<'T> * string -> unit
Public Shared Sub DoesNotContain(Of T) (expected As T, collection As IEnumerable(Of T), message As String)

Type Parameters

T

The type of the collection items.

Parameters

expected
T

The expected item.

collection
IEnumerable<T>

The collection.

message
String

The message to display when the assertion fails.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(Func<T,bool> predicate, System.Collections.Generic.IEnumerable<T> collection);
static member DoesNotContain : Func<'T, bool> * seq<'T> -> unit
Public Shared Sub DoesNotContain(Of T) (predicate As Func(Of T, Boolean), collection As IEnumerable(Of T))

Type Parameters

T

The type of the collection items.

Parameters

predicate
Func<T,Boolean>

A function to test each element for a condition.

collection
IEnumerable<T>

The collection.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(T expected, System.Collections.Generic.IEnumerable<T> collection);
static member DoesNotContain : 'T * seq<'T> -> unit
Public Shared Sub DoesNotContain(Of T) (expected As T, collection As IEnumerable(Of T))

Type Parameters

T

The type of the collection items.

Parameters

expected
T

The expected item.

collection
IEnumerable<T>

The collection.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(Func<T,bool> predicate, System.Collections.Generic.IEnumerable<T> collection, string? message, params object?[]? parameters);
static member DoesNotContain : Func<'T, bool> * seq<'T> * string * obj[] -> unit
Public Shared Sub DoesNotContain(Of T) (predicate As Func(Of T, Boolean), collection As IEnumerable(Of T), message As String, ParamArray parameters As Object())

Type Parameters

T

The type of the collection items.

Parameters

predicate
Func<T,Boolean>

A function to test each element for a condition.

collection
IEnumerable<T>

The collection.

message
String

The message to display when the assertion fails.

parameters
Object[]

The parameters to format the message.

Applies to

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

Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs
Source:
Assert.Contains.cs

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

public static void DoesNotContain<T>(Func<T,bool> predicate, System.Collections.Generic.IEnumerable<T> collection, string? message);
static member DoesNotContain : Func<'T, bool> * seq<'T> * string -> unit
Public Shared Sub DoesNotContain(Of T) (predicate As Func(Of T, Boolean), collection As IEnumerable(Of T), message As String)

Type Parameters

T

The type of the collection items.

Parameters

predicate
Func<T,Boolean>

A function to test each element for a condition.

collection
IEnumerable<T>

The collection.

message
String

The message to display when the assertion fails.

Applies to