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

DefaultConstraint

public class DefaultConstraint : Constraint
Tests that the actual value is default value for type.
using System; using System.Runtime.CompilerServices; namespace NUnit.Framework.Constraints { [NullableContext(1)] [Nullable(0)] public class DefaultConstraint : Constraint { public override string Description => "default"; public override ConstraintResult ApplyTo<[Nullable(2)] TActual>(TActual actual) { bool isSuccess = RuntimeHelpers.Equals(actual, default(TActual)); return new ConstraintResult(this, actual, isSuccess); } public DefaultConstraint() : base(Array.Empty<object>()) { } } }