Search Results for

    Show / Hide Table of Contents

    Class Contains

    Helper class with properties and methods that supply a number of constraints used in Asserts.

    Inheritance
    object
    Contains
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework
    Assembly: nunit.framework.dll
    Syntax
    public abstract class Contains

    Constructors

    View Source

    Contains()

    Declaration
    protected Contains()

    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
    Type Description
    SomeItemsConstraint
    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
    Type Description
    DictionaryContainsKeyConstraint
    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
    Type Description
    SubstringConstraint
    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
    Type Description
    DictionaryContainsValueConstraint
    • View Source
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0