Skip to content

Commit 36b8b1d

Browse files
Use IsNumericType
1 parent c999e34 commit 36b8b1d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NUnitFramework/framework/Constraints/EqualNumericWithoutUsingConstraint.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public ConstraintResult ApplyTo(T actual)
127127
// In that case fall back to the default equality comparison.
128128
bool hasSucceeded;
129129

130-
if (Numerics.IsNumericType(actual))
130+
if (Numerics.IsNumericType(typeof(T)))
131131
{
132132
hasSucceeded = Numerics.AreEqual(_expected, actual, ref _tolerance);
133133
}
@@ -155,7 +155,7 @@ public override ConstraintResult ApplyTo<TActual>(TActual actual)
155155
{
156156
hasSucceeded = false;
157157
}
158-
else if (actual is T t && Numerics.IsNumericType(t))
158+
else if (actual is T t && Numerics.IsNumericType(typeof(T)))
159159
{
160160
hasSucceeded = Numerics.AreEqual(_expected, t, ref _tolerance);
161161
}

0 commit comments

Comments
 (0)