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.
Inherited Members
Namespace: NUnit.Framework.Constraints
Assembly: nunit.framework.dll
Syntax
public class EqualStringWithoutUsingConstraint : Constraint, IConstraint, IResolveConstraint
Constructors
View SourceEqualStringWithoutUsingConstraint(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 SourceDescription
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
View SourceExpected
Gets the expected value.
Declaration
public string? Expected { get; }
Property Value
| Type | Description |
|---|---|
| string |
IgnoreCase
Flag the constraint to ignore case and return self.
Declaration
public EqualStringWithoutUsingConstraint IgnoreCase { get; }
Property Value
| Type | Description |
|---|---|
| EqualStringWithoutUsingConstraint |
IgnoreLineEndingFormat
Flag the constraint to ignore line ending format (\r vs. \n vs. \r\n) and return self.
Declaration
public EqualStringWithoutUsingConstraint IgnoreLineEndingFormat { get; }
Property Value
| Type | Description |
|---|---|
| EqualStringWithoutUsingConstraint |
IgnoreWhiteSpace
Flag the constraint to ignore white space and return self.
Declaration
public EqualStringWithoutUsingConstraint IgnoreWhiteSpace { get; }
Property Value
| Type | Description |
|---|---|
| EqualStringWithoutUsingConstraint |
NoClip
Flag the constraint to suppress string clipping and return self.
Declaration
public EqualStringWithoutUsingConstraint NoClip { get; }
Property Value
| Type | Description |
|---|---|
| EqualStringWithoutUsingConstraint |
Methods
View SourceApplyTo(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 |
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
Remarks
I wish we could hide this method, but it is public in the base class.