Content-Length: 223376 | pFad | https://github.com/nunit/nunit/commit/36b8b1d37ce76795272b0df4b7b279f8c3cae93c

83 Use IsNumericType · nunit/nunit@36b8b1d · GitHub
Skip to content

Commit

Permalink
Use IsNumericType
Browse files Browse the repository at this point in the history
  • Loading branch information
manfred-brands committed Dec 18, 2024
1 parent c999e34 commit 36b8b1d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public ConstraintResult ApplyTo(T actual)
// In that case fall back to the default equality comparison.
bool hasSucceeded;

if (Numerics.IsNumericType(actual))
if (Numerics.IsNumericType(typeof(T)))
{
hasSucceeded = Numerics.AreEqual(_expected, actual, ref _tolerance);
}
Expand Down Expand Up @@ -155,7 +155,7 @@ public override ConstraintResult ApplyTo<TActual>(TActual actual)
{
hasSucceeded = false;
}
else if (actual is T t && Numerics.IsNumericType(t))
else if (actual is T t && Numerics.IsNumericType(typeof(T)))
{
hasSucceeded = Numerics.AreEqual(_expected, t, ref _tolerance);
}
Expand Down

0 comments on commit 36b8b1d

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/nunit/nunit/commit/36b8b1d37ce76795272b0df4b7b279f8c3cae93c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy