Search Results for

    Show / Hide Table of Contents

    Class EqualStringWithoutUsingConstraint

    EqualConstraint is able to compare an actual value with the expected value provided in its constructor. Two objects are considered equal if both are null, or if both have the same value. NUnit has special semantics for some object types.

    Inheritance
    object
    Constraint
    EqualStringWithoutUsingConstraint
    EqualStringConstraint
    Implements
    IConstraint
    IResolveConstraint
    Inherited Members
    Constraint.ApplyTo<TActual>(ActualValueDelegate<TActual>)
    Constraint.ApplyTo<TActual>(ref TActual)
    Constraint.ApplyToAsync<TActual>(Func<Task<TActual>>)
    Constraint.GetTestObject<TActual>(ActualValueDelegate<TActual>)
    Constraint.ToString()
    Constraint.GetStringRepresentation(IEnumerable)
    Constraint.GetStringRepresentation()
    Constraint.After(int)
    Constraint.After(int, int)
    Constraint.DisplayName
    Constraint.Arguments
    Constraint.Builder
    Constraint.And
    Constraint.With
    Constraint.Or
    object.GetType()
    object.MemberwiseClone()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: NUnit.Framework.Constraints
    Assembly: nunit.framework.dll
    Syntax
    public class EqualStringWithoutUsingConstraint : Constraint, IConstraint, IResolveConstraint

    Constructors

    View Source

    EqualStringWithoutUsingConstraint(string?)

    Initializes a new instance of the EqualConstraint class.

    Declaration
    public EqualStringWithoutUsingConstraint(string? expected)
    Parameters
    Type Name Description
    string expected

    The expected 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

    Expected

    Gets the expected value.

    Declaration
    public string? Expected { get; }
    Property Value
    Type Description
    string
    View Source

    IgnoreCase

    Flag the constraint to ignore case and return self.

    Declaration
    public EqualStringWithoutUsingConstraint IgnoreCase { get; }
    Property Value
    Type Description
    EqualStringWithoutUsingConstraint
    View Source

    IgnoreWhiteSpace

    Flag the constraint to ignore white space and return self.

    Declaration
    public EqualStringWithoutUsingConstraint IgnoreWhiteSpace { get; }
    Property Value
    Type Description
    EqualStringWithoutUsingConstraint
    View Source

    NoClip

    Flag the constraint to suppress string clipping and return self.

    Declaration
    public EqualStringWithoutUsingConstraint NoClip { get; }
    Property Value
    Type Description
    EqualStringWithoutUsingConstraint

    Methods

    View Source

    ApplyTo(string?)

    Test whether the constraint is satisfied by a given value

    Declaration
    public ConstraintResult ApplyTo(string? actual)
    Parameters
    Type Name Description
    string actual

    The value to be tested

    Returns
    Type Description
    ConstraintResult

    True for success, false for failure

    View Source

    ApplyTo<TActual>(TActual)

    Applies the constraint to an actual value, returning a ConstraintResult.

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

    The value to be tested

    Returns
    Type Description
    ConstraintResult

    A ConstraintResult

    Type Parameters
    Name Description
    TActual
    Overrides
    Constraint.ApplyTo<TActual>(TActual)
    Remarks

    I wish we could hide this method, but it is public in the base class.

    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