mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 03:05:42 +00:00
Add tests for ComplexInfinity
This commit is contained in:
parent
8008a4a9ef
commit
d9277dbbf6
@ -1,4 +1,5 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Numerics;
|
||||||
|
|
||||||
namespace X10D.Tests.Core;
|
namespace X10D.Tests.Core;
|
||||||
|
|
||||||
@ -11,6 +12,22 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|||||||
[TestClass]
|
[TestClass]
|
||||||
public class DoubleTests
|
public class DoubleTests
|
||||||
{
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void ComplexSqrt()
|
||||||
|
{
|
||||||
|
Assert.AreEqual(0.0, 0.0.ComplexSqrt());
|
||||||
|
Assert.AreEqual(1.414213562373095, 2.0.ComplexSqrt());
|
||||||
|
Assert.AreEqual(3.0, 9.0.ComplexSqrt());
|
||||||
|
Assert.AreEqual(4.0, 16.0.ComplexSqrt());
|
||||||
|
Assert.AreEqual(new Complex(1.414213562373095, 1), (-2.0).ComplexSqrt());
|
||||||
|
Assert.AreEqual(new Complex(3.0, 1), (-9.0).ComplexSqrt());
|
||||||
|
Assert.AreEqual(new Complex(4.0, 1), (-16.0).ComplexSqrt());
|
||||||
|
Assert.AreEqual(Complex.NaN, double.NaN.ComplexSqrt());
|
||||||
|
Assert.AreEqual(new Complex(1, 1), (-1.0).ComplexSqrt());
|
||||||
|
Assert.AreEqual(Complex.Infinity, double.NegativeInfinity.ComplexSqrt());
|
||||||
|
Assert.AreEqual(Complex.Infinity, double.PositiveInfinity.ComplexSqrt());
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test for <see cref="DoubleExtensions.LerpTo" />
|
/// Test for <see cref="DoubleExtensions.LerpTo" />
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1,10 +1,27 @@
|
|||||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using System.Numerics;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
|
||||||
namespace X10D.Tests.Core;
|
namespace X10D.Tests.Core;
|
||||||
|
|
||||||
[TestClass]
|
[TestClass]
|
||||||
public class SingleTests
|
public class SingleTests
|
||||||
{
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void ComplexSqrt()
|
||||||
|
{
|
||||||
|
Assert.AreEqual(0.0f, 0.0f.ComplexSqrt());
|
||||||
|
Assert.AreEqual(1.4142135f, 2.0f.ComplexSqrt());
|
||||||
|
Assert.AreEqual(3.0f, 9.0f.ComplexSqrt());
|
||||||
|
Assert.AreEqual(4.0f, 16.0f.ComplexSqrt());
|
||||||
|
Assert.AreEqual(new Complex(1.4142135f, 1), (-2.0f).ComplexSqrt());
|
||||||
|
Assert.AreEqual(new Complex(3.0f, 1), (-9.0f).ComplexSqrt());
|
||||||
|
Assert.AreEqual(new Complex(4.0f, 1), (-16.0f).ComplexSqrt());
|
||||||
|
Assert.AreEqual(Complex.NaN, float.NaN.ComplexSqrt());
|
||||||
|
Assert.AreEqual(new Complex(1, 1), (-1.0f).ComplexSqrt());
|
||||||
|
Assert.AreEqual(Complex.Infinity, float.NegativeInfinity.ComplexSqrt());
|
||||||
|
Assert.AreEqual(Complex.Infinity, float.PositiveInfinity.ComplexSqrt());
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void DegreesToRadians()
|
public void DegreesToRadians()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user