-
-
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.
Merge pull request #84 from oliverbooth/feature/generic_math
Add support for generic math
- Loading branch information
Showing
39 changed files
with
755 additions
and
160 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using NUnit.Framework; | ||
using NUnit.Framework; | ||
using X10D.IO; | ||
|
||
namespace X10D.Tests.IO; | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using NUnit.Framework; | ||
using NUnit.Framework; | ||
using X10D.IO; | ||
|
||
namespace X10D.Tests.IO; | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using NUnit.Framework; | ||
using NUnit.Framework; | ||
using X10D.IO; | ||
|
||
namespace X10D.Tests.IO; | ||
|
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
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
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
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
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
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
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
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
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 |
Oops, something went wrong.