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

ConstraintUtils

static class ConstraintUtils
Provides methods to support consistent checking for constaints methods.
public static T RequireActual<T>(object actual, string paramName, bool allowNull = false)

Requires that the provided object is actually of the type required.