-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e51296d
commit d022a71
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#if NET7_0_OR_GREATER | ||
using NUnit.Framework; | ||
using X10D.Math; | ||
|
||
namespace X10D.Tests.Numerics; | ||
|
||
[TestFixture] | ||
internal class NumberTests | ||
{ | ||
[Test] | ||
public void Sign_ShouldReturn1_GivenPositiveNumber() | ||
{ | ||
Assert.That(NumberExtensions.Sign(2), Is.Positive); | ||
Assert.That(NumberExtensions.Sign(2), Is.EqualTo(1)); | ||
} | ||
|
||
[Test] | ||
public void Sign_Should0_GivenZero() | ||
{ | ||
Assert.That(NumberExtensions.Sign(0), Is.Not.Positive); | ||
Assert.That(NumberExtensions.Sign(0), Is.Not.Negative); | ||
Assert.That(NumberExtensions.Sign(0), Is.EqualTo(0)); | ||
} | ||
|
||
[Test] | ||
public void Sign_ShouldReturnNegative1_GivenNegativeNumber() | ||
{ | ||
Assert.That(NumberExtensions.Sign(-2), Is.Negative); | ||
Assert.That(NumberExtensions.Sign(-2), Is.EqualTo(-1)); | ||
} | ||
} | ||
#endif |