Search Results for

    Show / Hide Table of Contents

    Class IEqualWithUsingConstraintExtensions

    Allows specifying a custom comparer for the EqualConstraint.

    Inheritance
    object
    IEqualWithUsingConstraintExtensions
    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 static class IEqualWithUsingConstraintExtensions

    Methods

    View Source

    Using<TExpected>(IEqualWithUsingConstraint<TExpected>, IComparer<TExpected>)

    Flag the constraint to use the supplied IComparer object.

    Declaration
    public static EqualUsingConstraint<TExpected> Using<TExpected>(this IEqualWithUsingConstraint<TExpected> constraint, IComparer<TExpected> comparer)
    Parameters
    Type Name Description
    IEqualWithUsingConstraint<TExpected> constraint

    The constraint to add a user comparer to.

    IComparer<TExpected> comparer

    The comparer to use.

    Returns
    Type Description
    EqualUsingConstraint<TExpected>

    Equal constraint comparing Expected with an actual value using the user supplied comparer.

    Type Parameters
    Name Description
    TExpected

    The type of the expected value.

    View Source

    Using<TExpected>(IEqualWithUsingConstraint<TExpected>, IEqualityComparer<TExpected>)

    Flag the constraint to use the supplied IEqualityComparer object.

    Declaration
    public static EqualUsingConstraint<TExpected> Using<TExpected>(this IEqualWithUsingConstraint<TExpected> constraint, IEqualityComparer<TExpected> comparer)
    Parameters
    Type Name Description
    IEqualWithUsingConstraint<TExpected> constraint

    The constraint to add a user comparer to.

    IEqualityComparer<TExpected> comparer

    The comparer to use.

    Returns
    Type Description
    EqualUsingConstraint<TExpected>

    Equal constraint comparing Expected with an actual value using the user supplied comparer.

    Type Parameters
    Name Description
    TExpected

    The type of the expected value.

    View Source

    Using<TExpected>(IEqualWithUsingConstraint<TExpected>, IComparer)

    Flag the constraint to use the supplied IComparer object.

    Declaration
    public static EqualUsingConstraint<TExpected> Using<TExpected>(this IEqualWithUsingConstraint<TExpected> constraint, IComparer comparer)
    Parameters
    Type Name Description
    IEqualWithUsingConstraint<TExpected> constraint

    The constraint to add a user comparer to.

    IComparer comparer

    The comparer to use.

    Returns
    Type Description
    EqualUsingConstraint<TExpected>

    Equal constraint comparing Expected with an actual value using the user supplied comparer.

    Type Parameters
    Name Description
    TExpected

    The type of the expected value.

    View Source

    Using<TExpected>(IEqualWithUsingConstraint<TExpected>, IEqualityComparer)

    Flag the constraint to use the supplied IEqualityComparer object.

    Declaration
    public static EqualUsingConstraint<TExpected> Using<TExpected>(this IEqualWithUsingConstraint<TExpected> constraint, IEqualityComparer comparer)
    Parameters
    Type Name Description
    IEqualWithUsingConstraint<TExpected> constraint

    The constraint to add a user comparer to.

    IEqualityComparer comparer

    The comparer object to use.

    Returns
    Type Description
    EqualUsingConstraint<TExpected>

    Equal constraint comparing Expected with an actual value using the user supplied comparer.

    Type Parameters
    Name Description
    TExpected

    The type of the expected value.

    View Source

    Using<TExpected>(IEqualWithUsingConstraint<TExpected>, Comparison<TExpected>)

    Flag the constraint to use the supplied Comparison object.

    Declaration
    public static EqualUsingConstraint<TExpected> Using<TExpected>(this IEqualWithUsingConstraint<TExpected> constraint, Comparison<TExpected> comparer)
    Parameters
    Type Name Description
    IEqualWithUsingConstraint<TExpected> constraint

    The constraint to add a user comparer to.

    Comparison<TExpected> comparer

    The comparer to use.

    Returns
    Type Description
    EqualUsingConstraint<TExpected>

    Equal constraint comparing Expected with an actual value using the user supplied comparer.

    Type Parameters
    Name Description
    TExpected

    The type of the expected value.

    View Source

    Using<TExpected>(IEqualWithUsingConstraint<TExpected>, Func<TExpected, TExpected, bool>)

    Flag the constraint to use the supplied boolean-returning delegate.

    Declaration
    public static EqualUsingConstraint<TExpected> Using<TExpected>(this IEqualWithUsingConstraint<TExpected> constraint, Func<TExpected, TExpected, bool> comparer)
    Parameters
    Type Name Description
    IEqualWithUsingConstraint<TExpected> constraint

    The constraint to add a user comparer to.

    Func<TExpected, TExpected, bool> comparer

    The boolean-returning delegate to use.

    Returns
    Type Description
    EqualUsingConstraint<TExpected>

    Equal constraint comparing Expected with an actual value using the user supplied comparer.

    Type Parameters
    Name Description
    TExpected

    The type of the expected value.

    View Source

    Using<TActual, TExpected>(IEqualWithUsingConstraint<TExpected>, IComparer<TActual>)

    Flag the constraint to use the supplied IComparer object.

    Declaration
    public static EqualUsingConstraint<TExpected> Using<TActual, TExpected>(this IEqualWithUsingConstraint<TExpected> constraint, IComparer<TActual> comparer)
    Parameters
    Type Name Description
    IEqualWithUsingConstraint<TExpected> constraint

    The constraint to add a user comparer to.

    IComparer<TActual> comparer

    The comparer to use.

    Returns
    Type Description
    EqualUsingConstraint<TExpected>

    Equal constraint comparing Expected with an actual value using the user supplied comparer.

    Type Parameters
    Name Description
    TActual

    The type of the actual value.

    TExpected

    The type of the expected value.

    View Source

    Using<TActual, TExpected>(IEqualWithUsingConstraint<TExpected>, Func<TActual, TExpected, bool>)

    Flag the constraint to use the supplied predicate function

    Declaration
    public static EqualUsingConstraint<TExpected> Using<TActual, TExpected>(this IEqualWithUsingConstraint<TExpected> constraint, Func<TActual, TExpected, bool> comparer)
    Parameters
    Type Name Description
    IEqualWithUsingConstraint<TExpected> constraint

    The constraint to add a user comparer to.

    Func<TActual, TExpected, bool> comparer

    The comparison function to use.

    Returns
    Type Description
    EqualUsingConstraint<TExpected>

    Equal constraint comparing Expected with an actual value using the user supplied comparer.

    Type Parameters
    Name Description
    TActual

    The type of the actual value.

    TExpected

    The type of the expected value.

    • 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