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

NotConstraint

NotConstraint negates the effect of some other constraint
using System.Runtime.CompilerServices; namespace NUnit.Framework.Constraints { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] public class NotConstraint : PrefixConstraint { public NotConstraint(IConstraint baseConstraint) : base(baseConstraint, "not") { } public override ConstraintResult ApplyTo<[System.Runtime.CompilerServices.Nullable(2)] TActual>(TActual actual) { ConstraintResult constraintResult = base.BaseConstraint.ApplyTo(actual); return new ConstraintResult(this, constraintResult.ActualValue, !constraintResult.IsSuccess); } } }