Class Contains
Helper class with properties and methods that supply
a number of constraints used in Asserts.
Assembly: nunit.framework.dll
Syntax
public abstract class Contains
Constructors
View Source
Contains()
Declaration
Methods
View Source
Item(object?)
Returns a new SomeItemsConstraint checking for the
presence of a particular object in the collection.
Declaration
public static SomeItemsConstraint Item(object? expected)
Parameters
Type |
Name |
Description |
object |
expected |
|
Returns
View Source
Key(object)
Returns a new DictionaryContainsKeyConstraint checking for the
presence of a particular key in the dictionary.
Declaration
public static DictionaryContainsKeyConstraint Key(object expected)
Parameters
Type |
Name |
Description |
object |
expected |
|
Returns
View Source
Substring(string)
Returns a constraint that succeeds if the actual
value contains the substring supplied as an argument.
Declaration
public static SubstringConstraint Substring(string expected)
Parameters
Type |
Name |
Description |
string |
expected |
|
Returns
View Source
Value(object?)
Returns a new DictionaryContainsValueConstraint checking for the
presence of a particular value in the dictionary.
Declaration
public static DictionaryContainsValueConstraint Value(object? expected)
Parameters
Type |
Name |
Description |
object |
expected |
|
Returns