Sdílet prostřednictvím


Assert.DoesNotContain Method

Definition

Overloads

DoesNotContain(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.

DoesNotContain(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.

DoesNotContain(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.

DoesNotContain(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.

DoesNotContain(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.

DoesNotContain(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.

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>, String, Object[])

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>(Func<T,Boolean>, IEnumerable<T>, String, Object[])

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

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

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

DoesNotContain(String, String)

Source:
Assert.Contains.cs

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur 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 occur within value.

value
String

The string that is expected to contain substring.

Exceptions

value is null, or substring is null, or value does not contain substring.

Applies to

DoesNotContain(String, String, String)

Source:
Assert.Contains.cs

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur 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 occur within value.

value
String

The string that is expected to contain substring.

message
String

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

Exceptions

value is null, or substring is null, or value does not contain substring.

Applies to

DoesNotContain(String, String, StringComparison)

Source:
Assert.Contains.cs

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur 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 occur within value.

value
String

The string that is expected to contain substring.

comparisonType
StringComparison

The comparison method to compare strings comparisonType.

Exceptions

value is null, or substring is null, or value does not contain substring.

Applies to

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

Source:
Assert.Contains.cs

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur 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 occur within value.

value
String

The string that is expected to contain substring.

message
String

The message to include in the exception when substring is not 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 does not contain substring.

Applies to

DoesNotContain(String, String, StringComparison, String)

Source:
Assert.Contains.cs

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur 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 occur within value.

value
String

The string that is expected to contain substring.

comparisonType
StringComparison

The comparison method to compare strings comparisonType.

message
String

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

Exceptions

value is null, or substring is null, or value does not contain substring.

Applies to

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

Source:
Assert.Contains.cs

Tests whether the specified string contains the specified substring and throws an exception if the substring does not occur 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 occur within value.

value
String

The string that is expected to contain substring.

comparisonType
StringComparison

The comparison method to compare strings comparisonType.

message
String

The message to include in the exception when substring is not 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 does not contain substring.

Applies to

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

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

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)

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>(Func<T,Boolean>, IEnumerable<T>, String, Object[])

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

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

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

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

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

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