<PackageReference Include="NUnit" Version="4.3.0" />

EqualStringConstraint

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.
using System; using System.Collections.Generic; using System.Runtime.CompilerServices; namespace NUnit.Framework.Constraints { public class EqualStringConstraint : EqualStringWithoutUsingConstraint, IEqualWithUsingConstraint<string> { [NullableContext(2)] public EqualStringConstraint(string expected) : base(expected) { } [NullableContext(1)] public EqualUsingConstraint<string> Using(StringComparer comparer) { return new EqualUsingConstraint<string>(base.Expected, (IEqualityComparer<string>)comparer); } } }