Search Results for

    Show / Hide Table of Contents

    Class DictionaryContainsKeyValuePairConstraint

    DictionaryContainsKeyValuePairConstraint is used to test whether a dictionary contains an expected object as a key-value-pair.

    Inheritance
    object
    Constraint
    CollectionConstraint
    CollectionItemsEqualConstraint
    DictionaryContainsKeyValuePairConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    CollectionItemsEqualConstraint.Using(IComparer)
    CollectionItemsEqualConstraint.Using<T>(IComparer<T>)
    CollectionItemsEqualConstraint.Using<T>(Comparison<T>)
    CollectionItemsEqualConstraint.Using(IEqualityComparer)
    CollectionItemsEqualConstraint.Using<T>(IEqualityComparer<T>)
    CollectionItemsEqualConstraint.Using<T>(Func<T, T, bool>)
    CollectionItemsEqualConstraint.UsingPropertiesComparer()
    CollectionItemsEqualConstraint.IgnoreCase
    CollectionItemsEqualConstraint.IgnoreWhiteSpace
    Constraint.ApplyTo<TActual>(ActualValueDelegate<TActual>)
    Constraint.ApplyTo<TActual>(ref TActual)
    Constraint.ApplyToAsync<TActual>(Func<Task<TActual>>)
    Constraint.ToString()
    Constraint.After(int)
    Constraint.After(int, int)
    Constraint.Arguments
    Constraint.Builder
    Constraint.And
    Constraint.With
    Constraint.Or
    object.GetType()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public sealed class DictionaryContainsKeyValuePairConstraint : CollectionItemsEqualConstraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    DictionaryContainsKeyValuePairConstraint(object, object?)

    Construct a DictionaryContainsKeyValuePairConstraint

    Declaration
    public DictionaryContainsKeyValuePairConstraint(object key, object? value)
    Parameters
    Type Name Description
    object key
    object value

    Properties

    View Source

    Description

    The Description of what this constraint tests, for use in messages and in the ConstraintResult.

    Declaration
    public override string Description { get; }
    Property Value
    Type Description
    string
    Overrides
    Constraint.Description
    View Source

    DisplayName

    The display name of this Constraint for use by ToString(). The default value is the name of the constraint with trailing "Constraint" removed. Derived classes may set this to another name in their constructors.

    Declaration
    public override string DisplayName { get; }
    Property Value
    Type Description
    string
    Overrides
    Constraint.DisplayName

    Methods

    View Source

    ApplyTo<TActual>(TActual)

    Test whether the constraint is satisfied by a given value

    Declaration
    public override ConstraintResult ApplyTo<TActual>(TActual actual)
    Parameters
    Type Name Description
    TActual actual

    The value to be tested

    Returns
    Type Description
    ConstraintResult
    Type Parameters
    Name Description
    TActual
    Overrides
    CollectionConstraint.ApplyTo<TActual>(TActual)
    View Source

    Matches(IEnumerable)

    Test whether the expected key is contained in the dictionary

    Declaration
    protected override bool Matches(IEnumerable collection)
    Parameters
    Type Name Description
    IEnumerable collection
    Returns
    Type Description
    bool
    Overrides
    CollectionConstraint.Matches(IEnumerable)

    Implements

    IConstraint
    IResolveConstraint
    • 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