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

ConstraintUtils

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

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