diff --git a/Directory.Packages.props b/Directory.Packages.props
index f0264e296..6f28a4337 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -3,6 +3,9 @@
+
+
+
@@ -10,8 +13,5 @@
-
-
-
\ No newline at end of file
diff --git a/README.md b/README.md
index 401ec0128..bc9e7264c 100644
--- a/README.md
+++ b/README.md
@@ -132,7 +132,7 @@ xFunc is released under MIT License.
[Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/)
[Coverlet](https://github.com/coverlet-coverage/coverlet)
[ReportGenerator](https://github.com/danielpalme/ReportGenerator)
-[xUnit](https://github.com/xunit/xunit)
+[NUnit](https://github.com/nunit/nunit)
[NSubstitute](https://github.com/nsubstitute/NSubstitute)
[docfx](https://github.com/dotnet/docfx)
[BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet)
diff --git a/xFunc.Tests/Analyzers/DifferentiatorTests/DifferentiatorTest.cs b/xFunc.Tests/Analyzers/DifferentiatorTests/DifferentiatorTest.cs
index ea534ab06..bc0a83314 100644
--- a/xFunc.Tests/Analyzers/DifferentiatorTests/DifferentiatorTest.cs
+++ b/xFunc.Tests/Analyzers/DifferentiatorTests/DifferentiatorTest.cs
@@ -26,85 +26,85 @@ private IExpression Differentiate(IExpression exp, Variable variable, Expression
#region Common
- [Fact]
+ [Test]
public void NumberTest()
{
var exp = Differentiate(new Number(10));
- Assert.Equal(zero, exp);
+ Assert.That(exp, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void AngleNumberTest()
{
var exp = Differentiate(new Angle(AngleValue.Degree(10)));
- Assert.Equal(zero, exp);
+ Assert.That(exp, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void PowerNumberTest()
{
var exp = Differentiate(new Power(PowerValue.Watt(10)));
- Assert.Equal(zero, exp);
+ Assert.That(exp, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void TemperatureNumberTest()
{
var exp = Differentiate(TemperatureValue.Celsius(10).AsExpression());
- Assert.Equal(zero, exp);
+ Assert.That(exp, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void MassNumberTest()
{
var exp = Differentiate(MassValue.Kilogram(10).AsExpression());
- Assert.Equal(zero, exp);
+ Assert.That(exp, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void LengthNumberTest()
{
var exp = Differentiate(LengthValue.Kilometer(10).AsExpression());
- Assert.Equal(zero, exp);
+ Assert.That(exp, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void TimeNumberTest()
{
var exp = Differentiate(TimeValue.Second(10).AsExpression());
- Assert.Equal(zero, exp);
+ Assert.That(exp, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void AreaNumberTest()
{
var exp = Differentiate(AreaValue.Meter(10).AsExpression());
- Assert.Equal(zero, exp);
+ Assert.That(exp, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void VolumeNumberTest()
{
var exp = Differentiate(VolumeValue.Meter(10).AsExpression());
- Assert.Equal(zero, exp);
+ Assert.That(exp, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void VariableNullTest()
{
Assert.Throws(() => Differentiate(new Number(10), null));
}
- [Fact]
+ [Test]
public void AbsDerivativeTest1()
{
var exp = Differentiate(new Abs(Variable.X));
@@ -113,10 +113,10 @@ public void AbsDerivativeTest1()
new Div(Variable.X, new Abs(Variable.X))
);
- Assert.Equal(expected, exp);
+ Assert.That(exp, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void AbsPartialDerivativeTest1()
{
var exp = new Abs(new Mul(Variable.X, Variable.Y));
@@ -129,10 +129,10 @@ public void AbsPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void AbsPartialDerivativeTest2()
{
var exp = new Abs(new Mul(Variable.X, Variable.Y));
@@ -145,28 +145,28 @@ public void AbsPartialDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void AbsPartialDerivativeTest3()
{
var deriv = Differentiate(new Abs(Variable.X), Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void AddDerivativeTest1()
{
var exp = new Add(new Mul(Number.Two, Variable.X), new Number(3));
var deriv = Differentiate(exp);
var expected = new Mul(Number.Two, Number.One);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void AddDerivativeTest2()
{
var exp = new Add(
@@ -179,10 +179,10 @@ public void AddDerivativeTest2()
new Mul(new Number(3), Number.One)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void AddPartialDerivativeTest1()
{
var exp = new Add(
@@ -192,10 +192,10 @@ public void AddPartialDerivativeTest1()
var deriv = Differentiate(exp);
var expected = new Add(new Mul(Number.One, Variable.Y), Number.One);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void AddPartialDerivativeTest2()
{
var exp = new Add(
@@ -205,19 +205,19 @@ public void AddPartialDerivativeTest2()
var deriv = Differentiate(exp, Variable.Y);
var expected = new Add(new Mul(Variable.X, Number.One), Number.One);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void AddPartialDerivativeTest3()
{
var exp = new Add(Variable.X, Number.One);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void DivDerivativeTest1()
{
var exp = new Div(Number.One, Variable.X);
@@ -227,10 +227,10 @@ public void DivDerivativeTest1()
new Pow(Variable.X, Number.Two)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void DivDerivativeTest2()
{
// sin(x) / x
@@ -244,10 +244,10 @@ public void DivDerivativeTest2()
new Pow(Variable.X, Number.Two)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void DivPartialDerivativeTest1()
{
// (y + x ^ 2) / x
@@ -275,10 +275,10 @@ public void DivPartialDerivativeTest1()
new Pow(Variable.X, Number.Two)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void DivPartialDerivativeTest2()
{
var exp = new Div(Variable.Y, Variable.X);
@@ -288,40 +288,40 @@ public void DivPartialDerivativeTest2()
new Pow(Variable.X, Number.Two)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void DivPartialDerivativeTest3()
{
var exp = new Div(Variable.Y, Variable.X);
var deriv = Differentiate(exp, Variable.Y);
var expected = new Div(Number.One, Variable.X);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void DivPartialDerivativeTest4()
{
// (x + 1) / x
var exp = new Div(new Add(Variable.X, Number.One), Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ExpDerivativeTest1()
{
var exp = new Exp(Variable.X);
var deriv = Differentiate(exp);
var expected = new Mul(Number.One, new Exp(Variable.X));
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ExpDerivativeTest2()
{
var exp = new Exp(new Mul(Number.Two, Variable.X));
@@ -331,10 +331,10 @@ public void ExpDerivativeTest2()
new Exp(new Mul(Number.Two, Variable.X))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ExpPartialDerivativeTest1()
{
var exp = new Exp(new Mul(Variable.X, Variable.Y));
@@ -344,10 +344,10 @@ public void ExpPartialDerivativeTest1()
new Exp(new Mul(Variable.X, Variable.Y))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ExpPartialDerivativeTest2()
{
var exp = new Exp(new Mul(Variable.X, Variable.Y));
@@ -357,19 +357,19 @@ public void ExpPartialDerivativeTest2()
new Exp(new Mul(Variable.X, Variable.Y))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ExpPartialDerivativeTest3()
{
var exp = new Exp(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void LnDerivativeTest1()
{
var exp = new Ln(new Mul(Number.Two, Variable.X));
@@ -379,10 +379,10 @@ public void LnDerivativeTest1()
new Mul(Number.Two, Variable.X)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LnPartialDerivativeTest1()
{
// ln(xy)
@@ -393,10 +393,10 @@ public void LnPartialDerivativeTest1()
new Mul(Variable.X, Variable.Y)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LnPartialDerivativeTest2()
{
// ln(xy)
@@ -407,19 +407,19 @@ public void LnPartialDerivativeTest2()
new Mul(Variable.X, Variable.Y)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LnPartialDerivativeTest3()
{
var exp = new Ln(Variable.Y);
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void LgDerivativeTest1()
{
var exp = new Lg(new Mul(Number.Two, Variable.X));
@@ -429,10 +429,10 @@ public void LgDerivativeTest1()
new Mul(new Mul(Number.Two, Variable.X), new Ln(new Number(10)))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LgPartialDerivativeTest1()
{
// lg(2xy)
@@ -446,20 +446,20 @@ public void LgPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LgPartialDerivativeTest2()
{
// lg(2xy)
var exp = new Lg(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void LbDerivativeTest1()
{
var exp = new Lb(new Mul(Number.Two, Variable.X));
@@ -469,10 +469,10 @@ public void LbDerivativeTest1()
new Mul(new Mul(Number.Two, Variable.X), new Ln(Number.Two))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LbPartialDerivativeTest1()
{
// lb(2xy)
@@ -486,30 +486,30 @@ public void LbPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LbPartialDerivativeTest2()
{
// lb(2xy)
var exp = new Lb(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void LogDerivativeTest1()
{
var exp = new Log(Number.Two, Variable.X);
var deriv = Differentiate(exp);
var expected = new Div(Number.One, new Mul(Variable.X, new Ln(Number.Two)));
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LogDerivativeTest3()
{
var exp = new Log(Variable.X, Number.Two);
@@ -521,10 +521,10 @@ public void LogDerivativeTest3()
new Pow(new Ln(Variable.X), Number.Two)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LogPartialDerivativeTest1()
{
var exp = new Log(Number.Two, Variable.X);
@@ -534,29 +534,29 @@ public void LogPartialDerivativeTest1()
new Mul(Variable.X, new Ln(Number.Two))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void LogPartialDerivativeTest2()
{
var exp = new Log(Number.Two, Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void MulDerivativeTest1()
{
var exp = new Mul(Number.Two, Variable.X);
var deriv = Differentiate(exp);
var expected = new Mul(Number.Two, Number.One);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void MulPartialDerivativeTest1()
{
// (x + 1) * (y + x)
@@ -570,10 +570,10 @@ public void MulPartialDerivativeTest1()
new Mul(new Add(Variable.X, Number.One), Number.One)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void MulPartialDerivativeTest2()
{
// (y + 1) * (3 + x)
@@ -584,10 +584,10 @@ public void MulPartialDerivativeTest2()
var deriv = Differentiate(exp, Variable.Y);
var expected = new Mul(Number.One, new Add(new Number(3), Variable.X));
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void MulPartialDerivativeTest3()
{
// (x + 1) * (y + x)
@@ -598,10 +598,10 @@ public void MulPartialDerivativeTest3()
var deriv = Differentiate(exp, Variable.Y);
var expected = new Mul(new Add(Variable.X, Number.One), Number.One);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void MulPartialDerivativeTest4()
{
// (x + 1) * (3 + x)
@@ -611,10 +611,10 @@ public void MulPartialDerivativeTest4()
);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact(DisplayName = "x ^ 3")]
+ [Test]
public void PowDerivativeTest1()
{
var exp = new Pow(Variable.X, new Number(3));
@@ -624,10 +624,10 @@ public void PowDerivativeTest1()
new Mul(new Number(3), new Pow(Variable.X, new Sub(new Number(3), Number.One)))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact(DisplayName = "2 ^ (3x)")]
+ [Test]
public void PowDerivativeTest2()
{
var exp = new Pow(Number.Two, new Mul(new Number(3), Variable.X));
@@ -640,10 +640,10 @@ public void PowDerivativeTest2()
new Mul(new Number(3), Number.One)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact(DisplayName = "x ^ x")]
+ [Test]
public void PowXbyX()
{
var exp = new Pow(Variable.X, Variable.X);
@@ -655,10 +655,10 @@ public void PowXbyX()
new Mul(Variable.X, new Div(Number.One, Variable.X)))
);
- Assert.Equal(expected, result);
+ Assert.That(result, Is.EqualTo(expected));
}
- [Fact(DisplayName = "x ^ 2x")]
+ [Test]
public void PowXby2X()
{
var exp = new Pow(Variable.X, new Mul(Number.Two, Variable.X));
@@ -670,10 +670,10 @@ public void PowXby2X()
new Mul(new Mul(Number.Two, Variable.X), new Div(Number.One, Variable.X)))
);
- Assert.Equal(expected, result);
+ Assert.That(result, Is.EqualTo(expected));
}
- [Fact(DisplayName = "x ^ sin(x)")]
+ [Test]
public void PowXbySinX()
{
var exp = new Pow(Variable.X, new Sin(Variable.X));
@@ -686,10 +686,10 @@ public void PowXbySinX()
)
);
- Assert.Equal(expected, result);
+ Assert.That(result, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void PowPartialDerivativeTest1()
{
// (yx) ^ 3
@@ -706,10 +706,10 @@ public void PowPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void PowPartialDerivativeTest2()
{
// (yx) ^ 3
@@ -726,19 +726,19 @@ public void PowPartialDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void PowPartialDerivativeTest3()
{
var exp = new Pow(Variable.X, new Number(3));
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void RootDerivativeTest1()
{
var exp = new Root(Variable.X, new Number(3));
@@ -754,10 +754,10 @@ public void RootDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void RootPartialDerivativeTest1()
{
var exp = new Root(new Mul(Variable.X, Variable.Y), new Number(3));
@@ -773,19 +773,19 @@ public void RootPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void RootPartialDerivativeTest2()
{
var exp = new Root(Variable.Y, new Number(3));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void SqrtDerivativeTest1()
{
var exp = new Sqrt(new Mul(Number.Two, Variable.X));
@@ -795,10 +795,10 @@ public void SqrtDerivativeTest1()
new Mul(Number.Two, new Sqrt(new Mul(Number.Two, Variable.X)))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SqrtPartialDerivativeTest1()
{
// sqrt(2xy)
@@ -816,19 +816,19 @@ public void SqrtPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SqrtPartialDerivativeTest2()
{
var exp = new Sqrt(Variable.Y);
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void SubDerivativeTest1()
{
// x - sin(x)
@@ -839,100 +839,100 @@ public void SubDerivativeTest1()
new Mul(new Cos(Variable.X), Number.One)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SubPartialDerivativeTest1()
{
var exp = new Sub(new Mul(Variable.X, Variable.Y), Variable.Y);
var deriv = Differentiate(exp, Variable.Y);
var expected = new Sub(new Mul(Variable.X, Number.One), Number.One);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SubPartialDerivativeTest2()
{
var exp = new Sub(Variable.X, Variable.Y);
var deriv = Differentiate(exp);
- Assert.Equal(Number.One, deriv);
+ Assert.That(deriv, Is.EqualTo(Number.One));
}
- [Fact]
+ [Test]
public void SubPartialDerivativeTest3()
{
var exp = new Sub(Variable.X, Variable.Y);
var deriv = Differentiate(exp, Variable.Y);
var expected = new UnaryMinus(Number.One);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SubPartialDerivativeTest4()
{
var exp = new Sub(Variable.X, Number.One);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void UnaryMinusTest()
{
var exp = new UnaryMinus(new Sin(Variable.X));
var deriv = Differentiate(exp);
var expected = new UnaryMinus(new Mul(new Cos(Variable.X), Number.One));
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void UnaryMinusTest2()
{
var exp = new UnaryMinus(new Sin(new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void DiffVarTest()
{
var exp = new Mul(Variable.X, Variable.Y);
var deriv = Differentiate(exp);
var expected = new Mul(Number.One, Variable.Y);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void VarTest()
{
var exp = Variable.Y;
var deriv = Differentiate(exp);
- Assert.Equal(Variable.Y, deriv);
+ Assert.That(deriv, Is.EqualTo(Variable.Y));
}
#endregion Common
#region Trigonometric
- [Fact]
+ [Test]
public void SinDerivativeTest1()
{
var exp = new Sin(Variable.X);
var deriv = Differentiate(exp);
var expected = new Mul(new Cos(Variable.X), Number.One);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SinDerivativeTest2()
{
var exp = new Sin(new Mul(Number.Two, Variable.X));
@@ -942,10 +942,10 @@ public void SinDerivativeTest2()
new Mul(Number.Two, Number.One)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SinPartialDerivativeTest1()
{
var exp = new Sin(new Mul(Variable.X, Variable.Y));
@@ -955,10 +955,10 @@ public void SinPartialDerivativeTest1()
new Mul(Number.One, Variable.Y)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SinPartialDerivativeTest2()
{
var exp = new Sin(new Mul(Variable.X, Variable.Y));
@@ -968,29 +968,29 @@ public void SinPartialDerivativeTest2()
new Mul(Variable.X, Number.One)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SinPartialDerivativeTest3()
{
var exp = new Sin(Variable.Y);
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void CosDerivativeTest1()
{
var exp = new Cos(Variable.X);
var deriv = Differentiate(exp);
var expected = new UnaryMinus(new Mul(new Sin(Variable.X), Number.One));
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CosDerivativeTest2()
{
var exp = new Cos(new Mul(Number.Two, Variable.X));
@@ -1002,10 +1002,10 @@ public void CosDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CosPartialDerivativeTest1()
{
var exp = new Cos(new Mul(Variable.X, Variable.Y));
@@ -1017,10 +1017,10 @@ public void CosPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CosPartialDerivativeTest2()
{
var exp = new Cos(new Mul(Variable.X, Variable.Y));
@@ -1032,29 +1032,29 @@ public void CosPartialDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CosPartialDerivativeTest3()
{
var exp = new Cos(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void TanDerivativeTest1()
{
var exp = new Tan(Variable.X);
var deriv = Differentiate(exp);
var expected = new Div(Number.One, new Pow(new Cos(Variable.X), Number.Two));
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void TanDerivativeTest2()
{
var exp = new Tan(new Mul(Number.Two, Variable.X));
@@ -1064,10 +1064,10 @@ public void TanDerivativeTest2()
new Pow(new Cos(new Mul(Number.Two, Variable.X)), Number.Two)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void TanPartialDerivativeTest1()
{
var exp = new Tan(new Mul(Variable.X, Variable.Y));
@@ -1077,10 +1077,10 @@ public void TanPartialDerivativeTest1()
new Pow(new Cos(new Mul(Variable.X, Variable.Y)), Number.Two)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void TanPartialDerivativeTest2()
{
var exp = new Tan(new Mul(Variable.X, Variable.Y));
@@ -1090,19 +1090,19 @@ public void TanPartialDerivativeTest2()
new Pow(new Cos(new Mul(Variable.X, Variable.Y)), Number.Two)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void TanPartialDerivativeTest3()
{
var exp = new Tan(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void CotDerivativeTest1()
{
var exp = new Cot(Variable.X);
@@ -1111,10 +1111,10 @@ public void CotDerivativeTest1()
new Div(Number.One, new Pow(new Sin(Variable.X), Number.Two))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CotDerivativeTest2()
{
var exp = new Cot(new Mul(Number.Two, Variable.X));
@@ -1126,10 +1126,10 @@ public void CotDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CotPartialDerivativeTest1()
{
var exp = new Cot(new Mul(Variable.X, Variable.Y));
@@ -1141,10 +1141,10 @@ public void CotPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CotPartialDerivativeTest2()
{
var exp = new Cot(new Mul(Variable.X, Variable.Y));
@@ -1156,19 +1156,19 @@ public void CotPartialDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CotPartialDerivativeTest3()
{
var exp = new Cot(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void SecDerivativeTest1()
{
var exp = new Sec(new Mul(Number.Two, Variable.X));
@@ -1181,19 +1181,19 @@ public void SecDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SecDerivativeZeroTest()
{
var exp = new Sec(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void CscDerivativeTest()
{
var exp = new Csc(new Mul(Number.Two, Variable.X));
@@ -1206,10 +1206,10 @@ public void CscDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcsinDerivativeTest1()
{
var exp = new Arcsin(Variable.X);
@@ -1219,10 +1219,10 @@ public void ArcsinDerivativeTest1()
new Sqrt(new Sub(Number.One, new Pow(Variable.X, Number.Two)))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcsinDerivativeTest2()
{
var exp = new Arcsin(new Mul(Number.Two, Variable.X));
@@ -1237,10 +1237,10 @@ public void ArcsinDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcsinPartialDerivativeTest1()
{
var exp = new Arcsin(new Mul(Variable.X, Variable.Y));
@@ -1255,10 +1255,10 @@ public void ArcsinPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcsinPartialDerivativeTest2()
{
var exp = new Arcsin(new Mul(Variable.X, Variable.Y));
@@ -1273,19 +1273,19 @@ public void ArcsinPartialDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcsinPartialDerivativeTest3()
{
var exp = new Arcsin(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArccosDerivativeTest1()
{
var exp = new Arccos(Variable.X);
@@ -1297,10 +1297,10 @@ public void ArccosDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArccosDerivativeTest2()
{
var exp = new Arccos(new Mul(Number.Two, Variable.X));
@@ -1317,10 +1317,10 @@ public void ArccosDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArccosPartialDerivativeTest1()
{
var exp = new Arccos(new Mul(Variable.X, Variable.Y));
@@ -1337,10 +1337,10 @@ public void ArccosPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArccosPartialDerivativeTest2()
{
var exp = new Arccos(new Mul(Variable.X, Variable.Y));
@@ -1356,19 +1356,19 @@ public void ArccosPartialDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArccosPartialDerivativeTest3()
{
var exp = new Arccos(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArctanDerivativeTest1()
{
var exp = new Arctan(Variable.X);
@@ -1378,10 +1378,10 @@ public void ArctanDerivativeTest1()
new Add(Number.One, new Pow(Variable.X, Number.Two))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArctanDerivativeTest2()
{
var exp = new Arctan(new Mul(Number.Two, Variable.X));
@@ -1394,10 +1394,10 @@ public void ArctanDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArctanPartialDerivativeTest1()
{
var exp = new Arctan(new Mul(Variable.X, Variable.Y));
@@ -1410,10 +1410,10 @@ public void ArctanPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArctanPartialDerivativeTest2()
{
var exp = new Arctan(new Mul(Variable.X, Variable.Y));
@@ -1426,19 +1426,19 @@ public void ArctanPartialDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArctanPartialDerivativeTest3()
{
var exp = new Arctan(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArccotDerivativeTest1()
{
var exp = new Arccot(Variable.X);
@@ -1450,10 +1450,10 @@ public void ArccotDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArccotDerivativeTest2()
{
var exp = new Arccot(new Mul(Number.Two, Variable.X));
@@ -1468,10 +1468,10 @@ public void ArccotDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArccotPartialDerivativeTest1()
{
var exp = new Arccot(new Mul(Variable.X, Variable.Y));
@@ -1484,10 +1484,10 @@ public void ArccotPartialDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArccotPartialDerivativeTest2()
{
var exp = new Arccot(new Mul(Variable.X, Variable.Y));
@@ -1502,19 +1502,19 @@ public void ArccotPartialDerivativeTest2()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArccotPartialDerivativeTest3()
{
var exp = new Arccot(Variable.X);
var deriv = Differentiate(exp, Variable.Y);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArcsecDerivativeTest1()
{
var exp = new Arcsec(new Mul(Number.Two, Variable.X));
@@ -1532,19 +1532,19 @@ public void ArcsecDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcsecDerivativeZeroTest()
{
var exp = new Arcsec(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArccscDerivativeTest1()
{
var exp = new Arccsc(new Mul(Number.Two, Variable.X));
@@ -1563,23 +1563,23 @@ public void ArccscDerivativeTest1()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArccscDerivativeZeroTest()
{
var exp = new Arccsc(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
#endregion Trigonometric
#region Hyperbolic
- [Fact]
+ [Test]
public void SinhDerivativeTest()
{
var exp = new Sinh(new Mul(Number.Two, Variable.X));
@@ -1589,19 +1589,19 @@ public void SinhDerivativeTest()
new Cosh(new Mul(Number.Two, Variable.X))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SinhDerivativeZeroTest()
{
var exp = new Sinh(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void CoshDerivativeTest()
{
var exp = new Cosh(new Mul(Number.Two, Variable.X));
@@ -1611,19 +1611,19 @@ public void CoshDerivativeTest()
new Sinh(new Mul(Number.Two, Variable.X))
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CoshDerivativeZeroTest()
{
var exp = new Cosh(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void TanhDerivativeTest()
{
var exp = new Tanh(new Mul(Number.Two, Variable.X));
@@ -1633,19 +1633,19 @@ public void TanhDerivativeTest()
new Pow(new Cosh(new Mul(Number.Two, Variable.X)), Number.Two)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void TanhDerivativeZeroTest()
{
var exp = new Tanh(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void CothDerivativeTest()
{
var exp = new Coth(new Mul(Number.Two, Variable.X));
@@ -1657,19 +1657,19 @@ public void CothDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CothDerivativeZeroTest()
{
var exp = new Coth(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void SechDerivativeTest()
{
var exp = new Sech(new Mul(Number.Two, Variable.X));
@@ -1684,19 +1684,19 @@ public void SechDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void SechDerivativeZeroTest()
{
var exp = new Sech(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void CschDerivativeTest()
{
var exp = new Csch(new Mul(Number.Two, Variable.X));
@@ -1711,19 +1711,19 @@ public void CschDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void CschDerivativeZeroTest()
{
var exp = new Csch(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArsinehDerivativeTest()
{
var exp = new Arsinh(new Mul(Number.Two, Variable.X));
@@ -1738,19 +1738,19 @@ public void ArsinehDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArsinehDerivativeZeroTest()
{
var exp = new Arsinh(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArcoshDerivativeTest()
{
var exp = new Arcosh(new Mul(Number.Two, Variable.X));
@@ -1765,19 +1765,19 @@ public void ArcoshDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcoshDerivativeZeroTest()
{
var exp = new Arcosh(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArtanhDerivativeTest()
{
var exp = new Artanh(new Mul(Number.Two, Variable.X));
@@ -1790,19 +1790,19 @@ public void ArtanhDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArtanhDerivativeZeroTest()
{
var exp = new Artanh(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArcothDerivativeTest()
{
var exp = new Arcoth(new Mul(Number.Two, Variable.X));
@@ -1815,19 +1815,19 @@ public void ArcothDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcothDerivativeZeroTest()
{
var exp = new Arcoth(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void ArsechDerivativeTest()
{
var exp = new Arsech(new Mul(Number.Two, Variable.X));
@@ -1847,10 +1847,10 @@ public void ArsechDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcschDerivativeTest()
{
var exp = new Arcsch(new Mul(Number.Two, Variable.X));
@@ -1870,21 +1870,21 @@ public void ArcschDerivativeTest()
)
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void ArcschDerivativeZeroTest()
{
var exp = new Arcsch(new Mul(Number.Two, new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
#endregion Hyperbolic
- [Fact]
+ [Test]
public void DerivSimplify()
{
var simp = new Simplifier();
@@ -1892,20 +1892,20 @@ public void DerivSimplify()
var deriv = Differentiate(exp);
var expected = new Mul(new Cos(Variable.X), Number.One);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void DerivSimplify2()
{
var simp = new Simplifier();
var exp = new Simplify(simp, new Sin(new Variable("z")));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void DoubleDiffTest()
{
var diff = new Differentiator();
@@ -1925,10 +1925,10 @@ public void DoubleDiffTest()
new UnaryMinus(new Mul(new Sin(Variable.X), Number.One)), Number.One
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void DoubleDiffNoVarTest()
{
var diff = new Differentiator();
@@ -1937,10 +1937,10 @@ public void DoubleDiffNoVarTest()
var exp = new Derivative(diff, simp, new Derivative(diff, simp, new Sin(Number.One)));
var deriv = Differentiate(exp);
- Assert.Equal(zero, deriv);
+ Assert.That(deriv, Is.EqualTo(zero));
}
- [Fact]
+ [Test]
public void TripleDiffTest()
{
var diff = new Differentiator();
@@ -1967,10 +1967,10 @@ public void TripleDiffTest()
Number.One
);
- Assert.Equal(expected, deriv);
+ Assert.That(deriv, Is.EqualTo(expected));
}
- [Fact]
+ [Test]
public void NotSupportedTest()
{
Assert.Throws(() => Differentiate(new Fact(Variable.X)));
diff --git a/xFunc.Tests/Analyzers/DifferentiatorTests/NullArgumentTest.cs b/xFunc.Tests/Analyzers/DifferentiatorTests/NullArgumentTest.cs
index 0e23bed51..6f59c1d26 100644
--- a/xFunc.Tests/Analyzers/DifferentiatorTests/NullArgumentTest.cs
+++ b/xFunc.Tests/Analyzers/DifferentiatorTests/NullArgumentTest.cs
@@ -3,7 +3,7 @@
using System.Collections.Immutable;
using System.Reflection;
-using Xunit.Sdk;
+using NUnit.Framework.Internal;
namespace xFunc.Tests.Analyzers.DifferentiatorTests;
@@ -31,88 +31,88 @@ private void TestNullExp(Type type, object exp = null)
throw;
}
- throw new XunitException("The exception is expected.");
+ throw new NUnitException("The exception is expected.");
}
- [Theory]
- [InlineData(typeof(Abs))]
- [InlineData(typeof(Add))]
- [InlineData(typeof(Derivative))]
- [InlineData(typeof(Div))]
- [InlineData(typeof(Exp))]
- [InlineData(typeof(Lb))]
- [InlineData(typeof(Lg))]
- [InlineData(typeof(Ln))]
- [InlineData(typeof(Log))]
- [InlineData(typeof(Mul))]
- [InlineData(typeof(Number))]
- [InlineData(typeof(Angle))]
- [InlineData(typeof(Pow))]
- [InlineData(typeof(Root))]
- [InlineData(typeof(Simplify))]
- [InlineData(typeof(Sqrt))]
- [InlineData(typeof(Sub))]
- [InlineData(typeof(UnaryMinus))]
- [InlineData(typeof(Variable))]
- [InlineData(typeof(Arccos))]
- [InlineData(typeof(Arccot))]
- [InlineData(typeof(Arccsc))]
- [InlineData(typeof(Arcsec))]
- [InlineData(typeof(Arcsin))]
- [InlineData(typeof(Arctan))]
- [InlineData(typeof(Cos))]
- [InlineData(typeof(Cot))]
- [InlineData(typeof(Csc))]
- [InlineData(typeof(Sec))]
- [InlineData(typeof(Sin))]
- [InlineData(typeof(Tan))]
- [InlineData(typeof(Arcosh))]
- [InlineData(typeof(Arcoth))]
- [InlineData(typeof(Arcsch))]
- [InlineData(typeof(Arsech))]
- [InlineData(typeof(Arsinh))]
- [InlineData(typeof(Artanh))]
- [InlineData(typeof(Cosh))]
- [InlineData(typeof(Coth))]
- [InlineData(typeof(Csch))]
- [InlineData(typeof(Sech))]
- [InlineData(typeof(Sinh))]
- [InlineData(typeof(Tanh))]
+ [Test]
+ [TestCase(typeof(Abs))]
+ [TestCase(typeof(Add))]
+ [TestCase(typeof(Derivative))]
+ [TestCase(typeof(Div))]
+ [TestCase(typeof(Exp))]
+ [TestCase(typeof(Lb))]
+ [TestCase(typeof(Lg))]
+ [TestCase(typeof(Ln))]
+ [TestCase(typeof(Log))]
+ [TestCase(typeof(Mul))]
+ [TestCase(typeof(Number))]
+ [TestCase(typeof(Angle))]
+ [TestCase(typeof(Pow))]
+ [TestCase(typeof(Root))]
+ [TestCase(typeof(Simplify))]
+ [TestCase(typeof(Sqrt))]
+ [TestCase(typeof(Sub))]
+ [TestCase(typeof(UnaryMinus))]
+ [TestCase(typeof(Variable))]
+ [TestCase(typeof(Arccos))]
+ [TestCase(typeof(Arccot))]
+ [TestCase(typeof(Arccsc))]
+ [TestCase(typeof(Arcsec))]
+ [TestCase(typeof(Arcsin))]
+ [TestCase(typeof(Arctan))]
+ [TestCase(typeof(Cos))]
+ [TestCase(typeof(Cot))]
+ [TestCase(typeof(Csc))]
+ [TestCase(typeof(Sec))]
+ [TestCase(typeof(Sin))]
+ [TestCase(typeof(Tan))]
+ [TestCase(typeof(Arcosh))]
+ [TestCase(typeof(Arcoth))]
+ [TestCase(typeof(Arcsch))]
+ [TestCase(typeof(Arsech))]
+ [TestCase(typeof(Arsinh))]
+ [TestCase(typeof(Artanh))]
+ [TestCase(typeof(Cosh))]
+ [TestCase(typeof(Coth))]
+ [TestCase(typeof(Csch))]
+ [TestCase(typeof(Sech))]
+ [TestCase(typeof(Sinh))]
+ [TestCase(typeof(Tanh))]
public void TestExpressionNullArgument(Type type)
=> TestNullExp(type);
- [Theory]
- [InlineData(typeof(Abs))]
- [InlineData(typeof(Exp))]
- [InlineData(typeof(Lb))]
- [InlineData(typeof(Lg))]
- [InlineData(typeof(Ln))]
- [InlineData(typeof(Sqrt))]
- [InlineData(typeof(UnaryMinus))]
- [InlineData(typeof(Arccos))]
- [InlineData(typeof(Arccot))]
- [InlineData(typeof(Arccsc))]
- [InlineData(typeof(Arcsec))]
- [InlineData(typeof(Arcsin))]
- [InlineData(typeof(Arctan))]
- [InlineData(typeof(Cos))]
- [InlineData(typeof(Cot))]
- [InlineData(typeof(Csc))]
- [InlineData(typeof(Sec))]
- [InlineData(typeof(Sin))]
- [InlineData(typeof(Tan))]
- [InlineData(typeof(Arcosh))]
- [InlineData(typeof(Arcoth))]
- [InlineData(typeof(Arcsch))]
- [InlineData(typeof(Arsech))]
- [InlineData(typeof(Arsinh))]
- [InlineData(typeof(Artanh))]
- [InlineData(typeof(Cosh))]
- [InlineData(typeof(Coth))]
- [InlineData(typeof(Csch))]
- [InlineData(typeof(Sech))]
- [InlineData(typeof(Sinh))]
- [InlineData(typeof(Tanh))]
+ [Test]
+ [TestCase(typeof(Abs))]
+ [TestCase(typeof(Exp))]
+ [TestCase(typeof(Lb))]
+ [TestCase(typeof(Lg))]
+ [TestCase(typeof(Ln))]
+ [TestCase(typeof(Sqrt))]
+ [TestCase(typeof(UnaryMinus))]
+ [TestCase(typeof(Arccos))]
+ [TestCase(typeof(Arccot))]
+ [TestCase(typeof(Arccsc))]
+ [TestCase(typeof(Arcsec))]
+ [TestCase(typeof(Arcsin))]
+ [TestCase(typeof(Arctan))]
+ [TestCase(typeof(Cos))]
+ [TestCase(typeof(Cot))]
+ [TestCase(typeof(Csc))]
+ [TestCase(typeof(Sec))]
+ [TestCase(typeof(Sin))]
+ [TestCase(typeof(Tan))]
+ [TestCase(typeof(Arcosh))]
+ [TestCase(typeof(Arcoth))]
+ [TestCase(typeof(Arcsch))]
+ [TestCase(typeof(Arsech))]
+ [TestCase(typeof(Arsinh))]
+ [TestCase(typeof(Artanh))]
+ [TestCase(typeof(Cosh))]
+ [TestCase(typeof(Coth))]
+ [TestCase(typeof(Csch))]
+ [TestCase(typeof(Sech))]
+ [TestCase(typeof(Sinh))]
+ [TestCase(typeof(Tanh))]
public void TestUnaryContextNullArgument(Type type)
{
var exp = Create(type, Variable.X);
@@ -120,14 +120,14 @@ public void TestUnaryContextNullArgument(Type type)
Assert.Throws(() => exp.Analyze(differentiator, null));
}
- [Theory]
- [InlineData(typeof(Add))]
- [InlineData(typeof(Div))]
- [InlineData(typeof(Log))]
- [InlineData(typeof(Mul))]
- [InlineData(typeof(Pow))]
- [InlineData(typeof(Root))]
- [InlineData(typeof(Sub))]
+ [Test]
+ [TestCase(typeof(Add))]
+ [TestCase(typeof(Div))]
+ [TestCase(typeof(Log))]
+ [TestCase(typeof(Mul))]
+ [TestCase(typeof(Pow))]
+ [TestCase(typeof(Root))]
+ [TestCase(typeof(Sub))]
public void TestBinaryContextNullArgument(Type type)
{
var exp = Create(type, Variable.X, Variable.X);
@@ -135,7 +135,7 @@ public void TestBinaryContextNullArgument(Type type)
Assert.Throws(() => exp.Analyze(differentiator, null));
}
- [Fact]
+ [Test]
public void DerivContextArgumentTest()
{
var exp = new Derivative(differentiator, new Simplifier(), Variable.X);
@@ -143,7 +143,7 @@ public void DerivContextArgumentTest()
Assert.Throws(() => differentiator.Analyze(exp, null));
}
- [Fact]
+ [Test]
public void NumberContextArgumentTest()
{
var exp = Number.One;
@@ -151,7 +151,7 @@ public void NumberContextArgumentTest()
Assert.Throws(() => differentiator.Analyze(exp, null));
}
- [Fact]
+ [Test]
public void AngleContextArgumentTest()
{
var exp = AngleValue.Degree(10).AsExpression();
@@ -159,7 +159,7 @@ public void AngleContextArgumentTest()
Assert.Throws(() => differentiator.Analyze(exp, null));
}
- [Fact]
+ [Test]
public void SimplifyContextArgumentTest()
{
var exp = new Simplify(new Simplifier(), Variable.X);
@@ -167,7 +167,7 @@ public void SimplifyContextArgumentTest()
Assert.Throws(() => differentiator.Analyze(exp, null));
}
- [Fact]
+ [Test]
public void VariableContextArgumentTest()
{
var exp = Variable.X;
@@ -175,7 +175,7 @@ public void VariableContextArgumentTest()
Assert.Throws(() => differentiator.Analyze(exp, null));
}
- [Fact]
+ [Test]
public void CallExpressionContextNullArgument()
{
var exp = new CallExpression(
@@ -185,7 +185,7 @@ public void CallExpressionContextNullArgument()
Assert.Throws(() => exp.Analyze(differentiator, null));
}
- [Fact]
+ [Test]
public void LambdaExpressionContextNullArgument()
{
var exp = Variable.X.ToLambdaExpression(Variable.X.Name);
diff --git a/xFunc.Tests/Analyzers/Formatters/CommonFormatterTest.cs b/xFunc.Tests/Analyzers/Formatters/CommonFormatterTest.cs
index c93832e1e..da5166d0d 100644
--- a/xFunc.Tests/Analyzers/Formatters/CommonFormatterTest.cs
+++ b/xFunc.Tests/Analyzers/Formatters/CommonFormatterTest.cs
@@ -11,47 +11,47 @@ public class CommonFormatterTest
{
#region Common
- [Fact]
+ [Test]
public void AbsToStringTest()
{
var exp = new Abs(new Number(5));
- Assert.Equal("abs(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("abs(5)"));
}
- [Fact]
+ [Test]
public void AddToStringTest()
{
var exp = new Add(new Number(5), Number.Zero);
- Assert.Equal("5 + 0", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 + 0"));
}
- [Fact]
+ [Test]
public void AddToStringBinTest()
{
var exp = new Mul(Variable.X, new Add(new Number(5), Number.Zero));
- Assert.Equal("x * (5 + 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x * (5 + 0)"));
}
- [Fact]
+ [Test]
public void CeilToStringTest()
{
var ceil = new Ceil(new Number(5.55555555));
- Assert.Equal("ceil(5.55555555)", ceil.ToString());
+ Assert.That(ceil.ToString(), Is.EqualTo("ceil(5.55555555)"));
}
- [Fact]
+ [Test]
public void DefineToStringTest()
{
var exp = new Assign(Variable.X, Number.Zero);
- Assert.Equal("x := 0", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x := 0"));
}
- [Fact]
+ [Test]
public void DelToStringTest()
{
var exp = new Del(
@@ -66,487 +66,487 @@ public void DelToStringTest()
)
);
- Assert.Equal("del(((2 * x1) + (x2 ^ 2)) + (x3 ^ 3))", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("del(((2 * x1) + (x2 ^ 2)) + (x3 ^ 3))"));
}
- [Fact]
+ [Test]
public void DerivativeToStringExpTest()
{
var deriv = new Derivative(new Differentiator(), new Simplifier(), new Sin(Variable.X));
- Assert.Equal("deriv(sin(x))", deriv.ToString());
+ Assert.That(deriv.ToString(), Is.EqualTo("deriv(sin(x))"));
}
- [Fact]
+ [Test]
public void DerivativeToStringVarTest()
{
var deriv = new Derivative(new Differentiator(), new Simplifier(), new Sin(Variable.X), Variable.X);
- Assert.Equal("deriv(sin(x), x)", deriv.ToString());
+ Assert.That(deriv.ToString(), Is.EqualTo("deriv(sin(x), x)"));
}
- [Fact]
+ [Test]
public void DerivativeToStringPointTest()
{
var deriv = new Derivative(new Differentiator(), new Simplifier(), new Sin(Variable.X), Variable.X, Number.One);
- Assert.Equal("deriv(sin(x), x, 1)", deriv.ToString());
+ Assert.That(deriv.ToString(), Is.EqualTo("deriv(sin(x), x, 1)"));
}
- [Fact]
+ [Test]
public void DivToStringTest()
{
var exp = new Div(new Number(5), Number.Zero);
- Assert.Equal("5 / 0", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 / 0"));
}
- [Fact]
+ [Test]
public void DivToStringBinTest()
{
var exp = new Mul(Variable.X, new Div(new Number(5), Number.Zero));
- Assert.Equal("x * (5 / 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x * (5 / 0)"));
}
- [Fact]
+ [Test]
public void ExpToStringTest()
{
var exp = new Exp(new Number(5));
- Assert.Equal("exp(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("exp(5)"));
}
- [Fact]
+ [Test]
public void FactToStringTest()
{
var exp = new Fact(new Number(5));
- Assert.Equal("5!", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5!"));
}
- [Fact]
+ [Test]
public void FloorToStringTest()
{
var exp = new Floor(new Number(5.55555555));
- Assert.Equal("floor(5.55555555)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("floor(5.55555555)"));
}
- [Fact]
+ [Test]
public void TruncToStringTest()
{
var exp = new Trunc(new Number(5.55555555));
- Assert.Equal("trunc(5.55555555)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("trunc(5.55555555)"));
}
- [Fact]
+ [Test]
public void FracToStringTest()
{
var exp = new Frac(new Number(5.55555555));
- Assert.Equal("frac(5.55555555)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("frac(5.55555555)"));
}
- [Fact]
+ [Test]
public void GCDToStringTest()
{
var exp = new GCD(new Number(5), Number.Zero);
- Assert.Equal("gcd(5, 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("gcd(5, 0)"));
}
- [Fact]
+ [Test]
public void LCMToStringTest()
{
var exp = new LCM(new Number(5), Number.Zero);
- Assert.Equal("lcm(5, 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("lcm(5, 0)"));
}
- [Fact]
+ [Test]
public void LbToStringTest()
{
var exp = new Lb(new Number(5));
- Assert.Equal("lb(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("lb(5)"));
}
- [Fact]
+ [Test]
public void LgToStringTest()
{
var exp = new Lg(new Number(5));
- Assert.Equal("lg(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("lg(5)"));
}
- [Fact]
+ [Test]
public void LnToStringTest()
{
var exp = new Ln(new Number(5));
- Assert.Equal("ln(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("ln(5)"));
}
- [Fact]
+ [Test]
public void LogToStringTest()
{
var exp = new Log(Number.Zero, new Number(5));
- Assert.Equal("log(0, 5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("log(0, 5)"));
}
- [Fact]
+ [Test]
public void ModToStringTest()
{
var exp = new Mod(new Number(5), Number.Zero);
- Assert.Equal("5 % 0", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 % 0"));
}
- [Fact]
+ [Test]
public void ModToStringBinTest()
{
var exp = new Mul(Variable.X, new Mod(new Number(5), Number.Zero));
- Assert.Equal("x * (5 % 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x * (5 % 0)"));
}
- [Fact]
+ [Test]
public void MulToStringTest()
{
var exp = new Mul(new Number(5), Number.Zero);
- Assert.Equal("5 * 0", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 * 0"));
}
- [Fact]
+ [Test]
public void MulToStringAddTest()
{
var exp = new Add(Variable.X, new Mul(new Number(5), Number.Zero));
- Assert.Equal("x + (5 * 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x + (5 * 0)"));
}
- [Fact]
+ [Test]
public void MulToStringSubTest()
{
var exp = new Sub(Variable.X, new Mul(new Number(5), Number.Zero));
- Assert.Equal("x - (5 * 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x - (5 * 0)"));
}
- [Fact]
+ [Test]
public void MulToStringMulTest()
{
var exp = new Mul(Variable.X, new Mul(new Number(5), Number.Zero));
- Assert.Equal("x * (5 * 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x * (5 * 0)"));
}
- [Fact]
+ [Test]
public void MulToStringDivTest()
{
var exp = new Div(Variable.X, new Mul(new Number(5), Number.Zero));
- Assert.Equal("x / (5 * 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x / (5 * 0)"));
}
- [Fact]
+ [Test]
public void NumberTest()
{
var exp = new Number(3.3);
- Assert.Equal("3.3", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("3.3"));
}
- [Fact]
+ [Test]
public void AngleNumberTest()
{
var exp = AngleValue.Degree(10).AsExpression();
- Assert.Equal("10 degree", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("10 degree"));
}
- [Fact]
+ [Test]
public void PowerNumberTest()
{
var exp = PowerValue.Watt(10).AsExpression();
- Assert.Equal("10 W", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("10 W"));
}
- [Fact]
+ [Test]
public void TemperatureNumberTest()
{
var exp = TemperatureValue.Celsius(10).AsExpression();
- Assert.Equal("10 °C", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("10 °C"));
}
- [Fact]
+ [Test]
public void MassNumberTest()
{
var exp = MassValue.Gram(10).AsExpression();
- Assert.Equal("10 g", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("10 g"));
}
- [Fact]
+ [Test]
public void LengthNumberTest()
{
var exp = LengthValue.Meter(10).AsExpression();
- Assert.Equal("10 m", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("10 m"));
}
- [Fact]
+ [Test]
public void TimeNumberTest()
{
var exp = TimeValue.Second(10).AsExpression();
- Assert.Equal("10 s", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("10 s"));
}
- [Fact]
+ [Test]
public void AreaNumberTest()
{
var exp = AreaValue.Meter(10).AsExpression();
- Assert.Equal("10 m^2", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("10 m^2"));
}
- [Fact]
+ [Test]
public void VolumeNumberTest()
{
var exp = VolumeValue.Meter(10).AsExpression();
- Assert.Equal("10 m^3", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("10 m^3"));
}
- [Fact]
+ [Test]
public void ToDegreeTest()
{
var exp = new ToDegree(new Number(10));
- Assert.Equal("todegree(10)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("todegree(10)"));
}
- [Fact]
+ [Test]
public void ToRadianTest()
{
var exp = new ToRadian(new Number(10));
- Assert.Equal("toradian(10)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("toradian(10)"));
}
- [Fact]
+ [Test]
public void ToGradianTest()
{
var exp = new ToGradian(new Number(10));
- Assert.Equal("togradian(10)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("togradian(10)"));
}
- [Fact]
+ [Test]
public void ToNumberTest()
{
var exp = new ToNumber(AngleValue.Degree(10).AsExpression());
- Assert.Equal("tonumber(10 degree)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("tonumber(10 degree)"));
}
- [Fact]
+ [Test]
public void NumberSubTest()
{
var exp = new Sub(Number.One, new Number(-3.3));
- Assert.Equal("1 - -3.3", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("1 - -3.3"));
}
- [Fact]
+ [Test]
public void PowToStringTest()
{
var exp = new Pow(new Number(5), Number.Zero);
- Assert.Equal("5 ^ 0", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 ^ 0"));
}
- [Fact]
+ [Test]
public void PowToStringAddTest()
{
var exp = new Add(Variable.X, new Pow(new Number(5), Number.Zero));
- Assert.Equal("x + (5 ^ 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x + (5 ^ 0)"));
}
- [Fact]
+ [Test]
public void PowToStringSubTest()
{
var exp = new Sub(Variable.X, new Pow(new Number(5), Number.Zero));
- Assert.Equal("x - (5 ^ 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x - (5 ^ 0)"));
}
- [Fact]
+ [Test]
public void PowToStringMulTest()
{
var exp = new Mul(Variable.X, new Pow(new Number(5), Number.Zero));
- Assert.Equal("x * (5 ^ 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x * (5 ^ 0)"));
}
- [Fact]
+ [Test]
public void PowToStringDivTest()
{
var exp = new Div(Variable.X, new Pow(new Number(5), Number.Zero));
- Assert.Equal("x / (5 ^ 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x / (5 ^ 0)"));
}
- [Fact]
+ [Test]
public void RootToStringTest()
{
var exp = new Root(new Number(5), Number.Zero);
- Assert.Equal("root(5, 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("root(5, 0)"));
}
- [Fact]
+ [Test]
public void RoundToStringTest()
{
var exp = new Round(new Number(5), Number.Zero);
- Assert.Equal("round(5, 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("round(5, 0)"));
}
- [Fact]
+ [Test]
public void SimplifyToStringTest()
{
var exp = new Simplify(new Simplifier(), new Sin(Variable.X));
- Assert.Equal("simplify(sin(x))", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("simplify(sin(x))"));
}
- [Fact]
+ [Test]
public void SqrtToStringTest()
{
var exp = new Sqrt(new Number(5));
- Assert.Equal("sqrt(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("sqrt(5)"));
}
- [Fact]
+ [Test]
public void SubToStringTest()
{
var exp = new Sub(new Number(5), Number.Zero);
- Assert.Equal("5 - 0", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 - 0"));
}
- [Fact]
+ [Test]
public void SubToStringSubTest()
{
var exp = new Sub(Variable.X, new Sub(new Number(5), Number.Zero));
- Assert.Equal("x - (5 - 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x - (5 - 0)"));
}
- [Fact]
+ [Test]
public void SubToStringDivTest()
{
var exp = new Div(Variable.X, new Sub(new Number(5), Number.Zero));
- Assert.Equal("x / (5 - 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x / (5 - 0)"));
}
- [Fact]
+ [Test]
public void UnaryMinusToStringTest()
{
var exp = new UnaryMinus(new Number(5));
- Assert.Equal("-5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("-5"));
}
- [Fact]
+ [Test]
public void UnaryMinusToStringBinTest()
{
var exp = new UnaryMinus(new Add(new Number(5), Number.Zero));
- Assert.Equal("-(5 + 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("-(5 + 0)"));
}
- [Fact]
+ [Test]
public void UnaryMinusToStringSubTest()
{
var exp = new Sub(Number.Zero, new UnaryMinus(new Number(5)));
- Assert.Equal("0 - -5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("0 - -5"));
}
- [Fact]
+ [Test]
public void UndefineToStringTest()
{
var exp = new Unassign(Variable.X);
- Assert.Equal("undef(x)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("undef(x)"));
}
- [Fact]
+ [Test]
public void LambdaExpressionToStringArgTest()
{
var exp = new Add(Variable.X, Variable.Y)
.ToLambdaExpression(Variable.X, Variable.Y);
- Assert.Equal("(x, y) => x + y", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("(x, y) => x + y"));
}
- [Fact]
+ [Test]
public void CallExpressionToStringArgTest()
{
var exp = new CallExpression(
new Variable("f"),
new IExpression[] { new Number(5), Number.Two }.ToImmutableArray());
- Assert.Equal("f(5, 2)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("f(5, 2)"));
}
- [Fact]
+ [Test]
public void InlineCallExpressionToStringArgTest()
{
var exp = new CallExpression(
Variable.X.ToLambdaExpression(Variable.X.Name),
new IExpression[] { new Number(5) }.ToImmutableArray());
- Assert.Equal("((x) => x)(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("((x) => x)(5)"));
}
- [Fact]
+ [Test]
public void VariableTest()
{
var exp = Variable.X;
- Assert.Equal("x", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x"));
}
- [Fact]
+ [Test]
public void DelegateExpressionTest()
{
- var exp = new DelegateExpression(param => 0d);
+ var exp = new DelegateExpression(_ => 0d);
- Assert.Equal("{Delegate Expression}", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("{Delegate Expression}"));
}
- [Fact]
+ [Test]
public void StringExpressionTest()
{
var exp = new StringExpression("hello");
- Assert.Equal("'hello'", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("'hello'"));
}
- [Fact]
+ [Test]
public void ConvertTest()
{
var exp = new xFunc.Maths.Expressions.Units.Convert(
@@ -555,491 +555,491 @@ public void ConvertTest()
new StringExpression("rad")
);
- Assert.Equal("convert(90 degree, 'rad')", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("convert(90 degree, 'rad')"));
}
- [Fact]
+ [Test]
public void RationalTest()
{
var exp = new Rational(Number.One, Number.Two);
- Assert.Equal("1 // 2", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("1 // 2"));
}
- [Fact]
+ [Test]
public void ToRationalTest()
{
var exp = new ToRational(Number.Two);
- Assert.Equal("torational(2)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("torational(2)"));
}
#endregion Common
#region Complex Numbers
- [Fact]
+ [Test]
public void ComplexNumberPositiveNegativeToStringTest()
{
var complex = new ComplexNumber(3, -2);
- Assert.Equal("3-2i", complex.ToString());
+ Assert.That(complex.ToString(), Is.EqualTo("3-2i"));
}
- [Fact]
+ [Test]
public void ComplexNumberNegativePositiveToStringTest()
{
var complex = new ComplexNumber(-3, 2);
- Assert.Equal("-3+2i", complex.ToString());
+ Assert.That(complex.ToString(), Is.EqualTo("-3+2i"));
}
- [Fact]
+ [Test]
public void ComplexNumberTwoPositiveToStringTest()
{
var complex = new ComplexNumber(3, 2);
- Assert.Equal("3+2i", complex.ToString());
+ Assert.That(complex.ToString(), Is.EqualTo("3+2i"));
}
- [Fact]
+ [Test]
public void ComplexNumberTwoNegativeToStringTest()
{
var complex = new ComplexNumber(-3, -2);
- Assert.Equal("-3-2i", complex.ToString());
+ Assert.That(complex.ToString(), Is.EqualTo("-3-2i"));
}
- [Fact]
+ [Test]
public void ComplexNumberOnlyRealPartToStringTest()
{
var complex = new ComplexNumber(-3, 0);
- Assert.Equal("-3", complex.ToString());
+ Assert.That(complex.ToString(), Is.EqualTo("-3"));
}
- [Fact]
+ [Test]
public void ComplexNumberOnlyImaginaryPartToStringTest()
{
var complex = new ComplexNumber(0, -2);
- Assert.Equal("-2i", complex.ToString());
+ Assert.That(complex.ToString(), Is.EqualTo("-2i"));
}
- [Fact]
+ [Test]
public void ComplexNumberBinaryToStringTest()
{
var exp = new Add(new ComplexNumber(3, 2), new ComplexNumber(3, 2));
- Assert.Equal("3+2i + 3+2i", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("3+2i + 3+2i"));
}
- [Fact]
+ [Test]
public void ComplexNumberAbsToStringTest()
{
var exp = new Abs(new ComplexNumber(3, 2));
- Assert.Equal("abs(3+2i)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("abs(3+2i)"));
}
- [Fact]
+ [Test]
public void ComplexNumberIToStringTest()
{
var exp = new ComplexNumber(0, 1);
- Assert.Equal("i", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("i"));
}
- [Fact]
+ [Test]
public void ComplexNumberNegativeIToStringTest()
{
var exp = new ComplexNumber(0, -1);
- Assert.Equal("-i", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("-i"));
}
- [Fact]
+ [Test]
public void ConjugateToStringTest()
{
var complex = new Complex(3.1, 2.5);
var exp = new Conjugate(new ComplexNumber(complex));
- Assert.Equal("conjugate(3.1+2.5i)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("conjugate(3.1+2.5i)"));
}
- [Fact]
+ [Test]
public void ImToStringTest()
{
var complex = new Complex(3.1, 2.5);
var exp = new Im(new ComplexNumber(complex));
- Assert.Equal("im(3.1+2.5i)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("im(3.1+2.5i)"));
}
- [Fact]
+ [Test]
public void PhaseToStringTest()
{
var complex = new Complex(3.1, 2.5);
var exp = new Phase(new ComplexNumber(complex));
- Assert.Equal("phase(3.1+2.5i)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("phase(3.1+2.5i)"));
}
- [Fact]
+ [Test]
public void ReciprocalToStringTest()
{
var complex = new Complex(3.1, 2.5);
var exp = new Reciprocal(new ComplexNumber(complex));
- Assert.Equal("reciprocal(3.1+2.5i)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("reciprocal(3.1+2.5i)"));
}
- [Fact]
+ [Test]
public void ReToStringTest()
{
var complex = new Complex(3.1, 2.5);
var exp = new Re(new ComplexNumber(complex));
- Assert.Equal("re(3.1+2.5i)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("re(3.1+2.5i)"));
}
- [Fact]
+ [Test]
public void ToComplexToStringTest()
{
var exp = new ToComplex(Number.Two);
- Assert.Equal("tocomplex(2)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("tocomplex(2)"));
}
#endregion
#region Trigonometric
- [Fact]
+ [Test]
public void ArccosToStringTest()
{
var exp = new Arccos(new Number(5));
- Assert.Equal("arccos(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arccos(5)"));
}
- [Fact]
+ [Test]
public void ArccotToStringTest()
{
var exp = new Arccot(new Number(5));
- Assert.Equal("arccot(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arccot(5)"));
}
- [Fact]
+ [Test]
public void ArccscToStringTest()
{
var exp = new Arccsc(new Number(5));
- Assert.Equal("arccsc(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arccsc(5)"));
}
- [Fact]
+ [Test]
public void ArcsecToStringTest()
{
var exp = new Arcsec(new Number(5));
- Assert.Equal("arcsec(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arcsec(5)"));
}
- [Fact]
+ [Test]
public void ArcsinToStringTest()
{
var exp = new Arcsin(new Number(5));
- Assert.Equal("arcsin(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arcsin(5)"));
}
- [Fact]
+ [Test]
public void ArctanToStringTest()
{
var exp = new Arctan(new Number(5));
- Assert.Equal("arctan(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arctan(5)"));
}
- [Fact]
+ [Test]
public void CosToStringTest()
{
var exp = new Cos(new Number(5));
- Assert.Equal("cos(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("cos(5)"));
}
- [Fact]
+ [Test]
public void CotToStringTest()
{
var exp = new Cot(new Number(5));
- Assert.Equal("cot(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("cot(5)"));
}
- [Fact]
+ [Test]
public void CscToStringTest()
{
var exp = new Csc(new Number(5));
- Assert.Equal("csc(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("csc(5)"));
}
- [Fact]
+ [Test]
public void SecToStringTest()
{
var exp = new Sec(new Number(5));
- Assert.Equal("sec(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("sec(5)"));
}
- [Fact]
+ [Test]
public void SinToStringTest()
{
var exp = new Sin(new Number(5));
- Assert.Equal("sin(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("sin(5)"));
}
- [Fact]
+ [Test]
public void TanToStringTest()
{
var exp = new Tan(new Number(5));
- Assert.Equal("tan(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("tan(5)"));
}
#endregion
#region Hyperbolic
- [Fact]
+ [Test]
public void ArcoshToStringTest()
{
var exp = new Arcosh(new Number(5));
- Assert.Equal("arcosh(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arcosh(5)"));
}
- [Fact]
+ [Test]
public void ArcothToStringTest()
{
var exp = new Arcoth(new Number(5));
- Assert.Equal("arcoth(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arcoth(5)"));
}
- [Fact]
+ [Test]
public void ArcschToStringTest()
{
var exp = new Arcsch(new Number(5));
- Assert.Equal("arcsch(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arcsch(5)"));
}
- [Fact]
+ [Test]
public void ArsechToStringTest()
{
var exp = new Arsech(new Number(5));
- Assert.Equal("arsech(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arsech(5)"));
}
- [Fact]
+ [Test]
public void ArsinhToStringTest()
{
var exp = new Arsinh(new Number(5));
- Assert.Equal("arsinh(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("arsinh(5)"));
}
- [Fact]
+ [Test]
public void ArtanhToStringTest()
{
var exp = new Artanh(new Number(5));
- Assert.Equal("artanh(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("artanh(5)"));
}
- [Fact]
+ [Test]
public void CoshToStringTest()
{
var exp = new Cosh(new Number(5));
- Assert.Equal("cosh(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("cosh(5)"));
}
- [Fact]
+ [Test]
public void CothToStringTest()
{
var exp = new Coth(new Number(5));
- Assert.Equal("coth(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("coth(5)"));
}
- [Fact]
+ [Test]
public void CschToStringTest()
{
var exp = new Csch(new Number(5));
- Assert.Equal("csch(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("csch(5)"));
}
- [Fact]
+ [Test]
public void SechToStringTest()
{
var exp = new Sech(new Number(5));
- Assert.Equal("sech(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("sech(5)"));
}
- [Fact]
+ [Test]
public void SinhToStringTest()
{
var exp = new Sinh(new Number(5));
- Assert.Equal("sinh(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("sinh(5)"));
}
- [Fact]
+ [Test]
public void TanhToStringTest()
{
var exp = new Tanh(new Number(5));
- Assert.Equal("tanh(5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("tanh(5)"));
}
#endregion
#region Logical and Bitwise
- [Fact]
+ [Test]
public void BoolToStringTest()
{
var exp = Bool.False;
- Assert.Equal("False", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("False"));
}
- [Fact]
+ [Test]
public void AndAndToStringTest()
{
var exp = new And(Bool.True, new And(Bool.True, Bool.True));
- Assert.Equal("True and (True and True)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True and (True and True)"));
}
- [Fact]
+ [Test]
public void OrToStringTest()
{
var exp = new Or(Bool.True, Bool.True);
- Assert.Equal("True or True", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True or True"));
}
- [Fact]
+ [Test]
public void OrOrToStringTest()
{
var exp = new Or(Bool.True, new Or(Bool.True, Bool.True));
- Assert.Equal("True or (True or True)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True or (True or True)"));
}
- [Fact]
+ [Test]
public void XOrToStringTest()
{
var exp = new XOr(Bool.True, Bool.True);
- Assert.Equal("True xor True", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True xor True"));
}
- [Fact]
+ [Test]
public void XOrXOrToStringTest()
{
var exp = new XOr(Bool.True, new XOr(Bool.True, Bool.True));
- Assert.Equal("True xor (True xor True)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True xor (True xor True)"));
}
- [Fact]
+ [Test]
public void NotToStringTest()
{
var exp = new Not(Bool.True);
- Assert.Equal("not(True)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("not(True)"));
}
- [Fact]
+ [Test]
public void EqualityToStringTest1()
{
var eq = new Equality(Bool.True, Bool.False);
- Assert.Equal("True <=> False", eq.ToString());
+ Assert.That(eq.ToString(), Is.EqualTo("True <=> False"));
}
- [Fact]
+ [Test]
public void EqualityToStringTest2()
{
var eq = new And(new Equality(Bool.True, Bool.False), Bool.False);
- Assert.Equal("(True <=> False) and False", eq.ToString());
+ Assert.That(eq.ToString(), Is.EqualTo("(True <=> False) and False"));
}
- [Fact]
+ [Test]
public void ImplicationToStringTest1()
{
var eq = new Implication(Bool.True, Bool.False);
- Assert.Equal("True => False", eq.ToString());
+ Assert.That(eq.ToString(), Is.EqualTo("True => False"));
}
- [Fact]
+ [Test]
public void ImplicationToStringTest2()
{
var eq = new And(new Implication(Bool.True, Bool.False), Bool.False);
- Assert.Equal("(True => False) and False", eq.ToString());
+ Assert.That(eq.ToString(), Is.EqualTo("(True => False) and False"));
}
- [Fact]
+ [Test]
public void NAndToStringTest1()
{
var eq = new NAnd(Bool.True, Bool.False);
- Assert.Equal("True nand False", eq.ToString());
+ Assert.That(eq.ToString(), Is.EqualTo("True nand False"));
}
- [Fact]
+ [Test]
public void NAndToStringTest2()
{
var eq = new And(new NAnd(Bool.True, Bool.False), Bool.False);
- Assert.Equal("(True nand False) and False", eq.ToString());
+ Assert.That(eq.ToString(), Is.EqualTo("(True nand False) and False"));
}
- [Fact]
+ [Test]
public void NOrToStringTest1()
{
var eq = new NOr(Bool.True, Bool.False);
- Assert.Equal("True nor False", eq.ToString());
+ Assert.That(eq.ToString(), Is.EqualTo("True nor False"));
}
- [Fact]
+ [Test]
public void NOrToStringTest2()
{
var eq = new And(new NOr(Bool.True, Bool.False), Bool.False);
- Assert.Equal("(True nor False) and False", eq.ToString());
+ Assert.That(eq.ToString(), Is.EqualTo("(True nor False) and False"));
}
#endregion
#region Matrix
- [Fact]
+ [Test]
public void MatrixToStringTest()
{
var matrix = new Matrix(new[]
@@ -1048,10 +1048,10 @@ public void MatrixToStringTest()
new Matrices.Vector(new IExpression[] { new Number(4), Number.Zero })
});
- Assert.Equal("{{1, -2}, {4, 0}}", matrix.ToString());
+ Assert.That(matrix.ToString(), Is.EqualTo("{{1, -2}, {4, 0}}"));
}
- [Fact]
+ [Test]
public void DeterminantToStringTest()
{
var matrix = new Matrix(new[]
@@ -1062,10 +1062,10 @@ public void DeterminantToStringTest()
var det = new Determinant(matrix);
- Assert.Equal("det({{1, -2}, {4, 0}})", det.ToString());
+ Assert.That(det.ToString(), Is.EqualTo("det({{1, -2}, {4, 0}})"));
}
- [Fact]
+ [Test]
public void InverseToStringTest()
{
var matrix = new Matrix(new[]
@@ -1076,30 +1076,30 @@ public void InverseToStringTest()
var exp = new Inverse(matrix);
- Assert.Equal("inverse({{1, -2}, {4, 0}})", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("inverse({{1, -2}, {4, 0}})"));
}
- [Fact]
+ [Test]
public void DotProductToStringTest()
{
var left = new Matrices.Vector(new IExpression[] { Number.One, new Number(-2) });
var right = new Matrices.Vector(new IExpression[] { new Number(4), Number.Zero });
var exp = new DotProduct(left, right);
- Assert.Equal("dotProduct({1, -2}, {4, 0})", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("dotProduct({1, -2}, {4, 0})"));
}
- [Fact]
+ [Test]
public void CrossProductToStringTest()
{
var left = new Matrices.Vector(new IExpression[] { Number.One, new Number(-2) });
var right = new Matrices.Vector(new IExpression[] { new Number(4), Number.Zero });
var exp = new CrossProduct(left, right);
- Assert.Equal("crossProduct({1, -2}, {4, 0})", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("crossProduct({1, -2}, {4, 0})"));
}
- [Fact]
+ [Test]
public void TransposeToStringTest()
{
var matrix = new Matrix(new[]
@@ -1110,452 +1110,452 @@ public void TransposeToStringTest()
var exp = new Transpose(matrix);
- Assert.Equal("transpose({{1, -2}, {4, 0}})", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("transpose({{1, -2}, {4, 0}})"));
}
#endregion
#region Statistical
- [Fact]
+ [Test]
public void AvgToStringTest()
{
var sum = new Avg(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("avg(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("avg(1, 2)"));
}
- [Fact]
+ [Test]
public void AvgToStringTest2()
{
var sum = new Avg(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("avg({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("avg({1, 2})"));
}
- [Fact]
+ [Test]
public void CountToStringTest()
{
var sum = new Count(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("count(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("count(1, 2)"));
}
- [Fact]
+ [Test]
public void CountToStringTest2()
{
var sum = new Count(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("count({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("count({1, 2})"));
}
- [Fact]
+ [Test]
public void ToStringTest()
{
var sum = new Max(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("max(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("max(1, 2)"));
}
- [Fact]
+ [Test]
public void ToStringTest2()
{
var sum = new Max(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("max({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("max({1, 2})"));
}
- [Fact]
+ [Test]
public void MinToStringTest()
{
var sum = new Min(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("min(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("min(1, 2)"));
}
- [Fact]
+ [Test]
public void MinToStringTest2()
{
var sum = new Min(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("min({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("min({1, 2})"));
}
- [Fact]
+ [Test]
public void ProductToStringTest()
{
var sum = new Product(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("product(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("product(1, 2)"));
}
- [Fact]
+ [Test]
public void ProductToStringTest2()
{
var sum = new Product(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("product({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("product({1, 2})"));
}
- [Fact]
+ [Test]
public void StdevpToStringTest()
{
var sum = new Stdevp(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("stdevp(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("stdevp(1, 2)"));
}
- [Fact]
+ [Test]
public void StdevpToStringTest2()
{
var sum = new Stdevp(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("stdevp({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("stdevp({1, 2})"));
}
- [Fact]
+ [Test]
public void StdevToStringTest()
{
var sum = new Stdev(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("stdev(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("stdev(1, 2)"));
}
- [Fact]
+ [Test]
public void StdevToStringTest2()
{
var sum = new Stdev(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("stdev({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("stdev({1, 2})"));
}
- [Fact]
+ [Test]
public void SumToStringTest()
{
var sum = new Sum(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("sum(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("sum(1, 2)"));
}
- [Fact]
+ [Test]
public void SumToStringTest2()
{
var sum = new Sum(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("sum({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("sum({1, 2})"));
}
- [Fact]
+ [Test]
public void VarpToStringTest()
{
var sum = new Varp(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("varp(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("varp(1, 2)"));
}
- [Fact]
+ [Test]
public void VarpToStringTest2()
{
var sum = new Varp(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("varp({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("varp({1, 2})"));
}
- [Fact]
+ [Test]
public void VarToStringTest()
{
var sum = new Var(new IExpression[] { Number.One, Number.Two });
- Assert.Equal("var(1, 2)", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("var(1, 2)"));
}
- [Fact]
+ [Test]
public void VarToStringTest2()
{
var sum = new Var(new IExpression[] { new Matrices.Vector(new IExpression[] { Number.One, Number.Two }) });
- Assert.Equal("var({1, 2})", sum.ToString());
+ Assert.That(sum.ToString(), Is.EqualTo("var({1, 2})"));
}
#endregion
#region Programming
- [Fact]
+ [Test]
public void AddAssignToString()
{
var exp = new AddAssign(Variable.X, new Number(5));
- Assert.Equal("x += 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x += 5"));
}
- [Fact]
+ [Test]
public void SubAssignToString()
{
var exp = new SubAssign(Variable.X, new Number(5));
- Assert.Equal("x -= 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x -= 5"));
}
- [Fact]
+ [Test]
public void MulAssignToString()
{
var exp = new MulAssign(Variable.X, new Number(5));
- Assert.Equal("x *= 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x *= 5"));
}
- [Fact]
+ [Test]
public void DivAssignToString()
{
var exp = new DivAssign(Variable.X, new Number(5));
- Assert.Equal("x /= 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x /= 5"));
}
- [Fact]
+ [Test]
public void IncToString()
{
var exp = new Inc(Variable.X);
- Assert.Equal("x++", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x++"));
}
- [Fact]
+ [Test]
public void DecToString()
{
var exp = new Dec(Variable.X);
- Assert.Equal("x--", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("x--"));
}
- [Fact]
+ [Test]
public void CondAndToString()
{
var exp = new ConditionalAnd(Bool.True, Bool.True);
- Assert.Equal("True && True", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True && True"));
}
- [Fact]
+ [Test]
public void CondAndCondAndToString()
{
var exp = new ConditionalAnd(Bool.True, new ConditionalAnd(Bool.True, Bool.True));
- Assert.Equal("True && (True && True)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True && (True && True)"));
}
- [Fact]
+ [Test]
public void CondOrToString()
{
var exp = new ConditionalOr(Bool.True, Bool.True);
- Assert.Equal("True || True", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True || True"));
}
- [Fact]
+ [Test]
public void CondOrCondOrToString()
{
var exp = new ConditionalOr(Bool.True, new ConditionalOr(Bool.True, Bool.True));
- Assert.Equal("True || (True || True)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True || (True || True)"));
}
- [Fact]
+ [Test]
public void EqualToString()
{
var exp = new Equal(new Number(5), new Number(5));
- Assert.Equal("5 == 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 == 5"));
}
- [Fact]
+ [Test]
public void EqualEqualToString()
{
var exp = new Equal(Bool.True, new Equal(new Number(5), new Number(5)));
- Assert.Equal("True == (5 == 5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True == (5 == 5)"));
}
- [Fact]
+ [Test]
public void NotEqualToString()
{
var exp = new NotEqual(new Number(5), new Number(5));
- Assert.Equal("5 != 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 != 5"));
}
- [Fact]
+ [Test]
public void NotEqualNotEqualToString()
{
var exp = new NotEqual(Bool.True, new NotEqual(new Number(5), new Number(5)));
- Assert.Equal("True != (5 != 5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True != (5 != 5)"));
}
- [Fact]
+ [Test]
public void LessToString()
{
var exp = new LessThan(new Number(5), new Number(5));
- Assert.Equal("5 < 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 < 5"));
}
- [Fact]
+ [Test]
public void LessLessToString()
{
var exp = new ConditionalAnd(Bool.True, new LessThan(new Number(5), new Number(5)));
- Assert.Equal("True && (5 < 5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True && (5 < 5)"));
}
- [Fact]
+ [Test]
public void LessOrEqualToString()
{
var exp = new LessOrEqual(new Number(5), new Number(5));
- Assert.Equal("5 <= 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 <= 5"));
}
- [Fact]
+ [Test]
public void LessOrEqualLessOrEqualToString()
{
var exp = new ConditionalAnd(Bool.True, new LessOrEqual(new Number(5), new Number(5)));
- Assert.Equal("True && (5 <= 5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True && (5 <= 5)"));
}
- [Fact]
+ [Test]
public void GreatToString()
{
var exp = new GreaterThan(new Number(5), new Number(5));
- Assert.Equal("5 > 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 > 5"));
}
- [Fact]
+ [Test]
public void GreatGreatToString()
{
var exp = new ConditionalAnd(Bool.True, new GreaterThan(new Number(5), new Number(5)));
- Assert.Equal("True && (5 > 5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True && (5 > 5)"));
}
- [Fact]
+ [Test]
public void GreatOrEqualToString()
{
var exp = new GreaterOrEqual(new Number(5), new Number(5));
- Assert.Equal("5 >= 5", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("5 >= 5"));
}
- [Fact]
+ [Test]
public void GreatOrEqualGreatOrEqualToString()
{
var exp = new ConditionalAnd(Bool.True, new GreaterOrEqual(new Number(5), new Number(5)));
- Assert.Equal("True && (5 >= 5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("True && (5 >= 5)"));
}
- [Fact]
+ [Test]
public void IfToString()
{
var exp = new If(new Equal(new Number(5), new Number(5)), new Number(5));
- Assert.Equal("if(5 == 5, 5)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("if(5 == 5, 5)"));
}
- [Fact]
+ [Test]
public void IfElseToString()
{
var exp = new If(new Equal(new Number(5), new Number(5)), new Number(5), Number.Zero);
- Assert.Equal("if(5 == 5, 5, 0)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("if(5 == 5, 5, 0)"));
}
- [Fact]
+ [Test]
public void ForToString()
{
var exp = new For(new Number(5), new Assign(Variable.X, Number.Zero), new Equal(new Number(5), new Number(5)), new AddAssign(Variable.X, Number.One));
- Assert.Equal("for(5, x := 0, 5 == 5, x += 1)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("for(5, x := 0, 5 == 5, x += 1)"));
}
- [Fact]
+ [Test]
public void WhileToString()
{
var exp = new While(new Number(5), new Equal(new Number(5), new Number(5)));
- Assert.Equal("while(5, (5 == 5))", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("while(5, (5 == 5))"));
}
- [Fact]
+ [Test]
public void SignToString()
{
var exp = new Sign(new Number(-5));
var str = exp.ToString();
- Assert.Equal("sign(-5)", str);
+ Assert.That(str, Is.EqualTo("sign(-5)"));
}
- [Fact]
+ [Test]
public void LeftShiftTest()
{
var exp = new LeftShift(Number.One, new Number(10));
var str = exp.ToString();
- Assert.Equal("1 << 10", str);
+ Assert.That(str, Is.EqualTo("1 << 10"));
}
- [Fact]
+ [Test]
public void RightShiftTest()
{
var exp = new RightShift(Number.One, new Number(10));
var str = exp.ToString();
- Assert.Equal("1 >> 10", str);
+ Assert.That(str, Is.EqualTo("1 >> 10"));
}
- [Fact]
+ [Test]
public void LeftShiftAssignTest()
{
var exp = new LeftShiftAssign(Variable.X, new Number(10));
var str = exp.ToString();
- Assert.Equal("x <<= 10", str);
+ Assert.That(str, Is.EqualTo("x <<= 10"));
}
- [Fact]
+ [Test]
public void RightShiftAssignTest()
{
var exp = new RightShiftAssign(Variable.X, new Number(10));
var str = exp.ToString();
- Assert.Equal("x >>= 10", str);
+ Assert.That(str, Is.EqualTo("x >>= 10"));
}
- [Fact]
+ [Test]
public void ToBinTest()
{
var exp = new ToBin(new Number(10));
- Assert.Equal("tobin(10)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("tobin(10)"));
}
- [Fact]
+ [Test]
public void ToOctTest()
{
var exp = new ToOct(new Number(10));
- Assert.Equal("tooct(10)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("tooct(10)"));
}
- [Fact]
+ [Test]
public void ToHexTest()
{
var exp = new ToHex(new Number(10));
- Assert.Equal("tohex(10)", exp.ToString());
+ Assert.That(exp.ToString(), Is.EqualTo("tohex(10)"));
}
#endregion
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/AddSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/AddSimplifierTest.cs
index ce270ed4d..33d6ff244 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/AddSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/AddSimplifierTest.cs
@@ -5,7 +5,7 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class AddSimplifierTest : BaseSimplifierTest
{
- [Fact(DisplayName = "2 + x")]
+ [Test]
public void Order1()
{
var add = new Add(Number.Two, Variable.X);
@@ -14,7 +14,7 @@ public void Order1()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "0 + 1")]
+ [Test]
public void AddFirstZero()
{
var add = new Add(Number.Zero, Number.One);
@@ -23,7 +23,7 @@ public void AddFirstZero()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "1 + 0")]
+ [Test]
public void AddSecondZero()
{
var add = new Add(Number.One, Number.Zero);
@@ -32,7 +32,7 @@ public void AddSecondZero()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "3 + 2")]
+ [Test]
public void AddTwoNumbers()
{
var add = new Add(new Number(3), Number.Two);
@@ -41,7 +41,7 @@ public void AddTwoNumbers()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "90 + 2 rad")]
+ [Test]
public void AddNumberAngle()
{
var add = new Add(
@@ -53,7 +53,7 @@ public void AddNumberAngle()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "90 deg + 2")]
+ [Test]
public void AddAngleNumber()
{
var add = new Add(
@@ -65,7 +65,7 @@ public void AddAngleNumber()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "90 deg + 2 rad")]
+ [Test]
public void AddTwoAngles()
{
var add = new Add(
@@ -77,7 +77,7 @@ public void AddTwoAngles()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 + 10 W")]
+ [Test]
public void AddNumberAndPower()
{
var add = new Add(
@@ -89,7 +89,7 @@ public void AddNumberAndPower()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 W + 10")]
+ [Test]
public void AddPowerAndNumber()
{
var add = new Add(
@@ -101,7 +101,7 @@ public void AddPowerAndNumber()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 W + 10 kW")]
+ [Test]
public void AddTwoPowers()
{
var add = new Add(
@@ -113,7 +113,7 @@ public void AddTwoPowers()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 + 10 C°")]
+ [Test]
public void AddNumberAndTemperature()
{
var add = new Add(
@@ -125,7 +125,7 @@ public void AddNumberAndTemperature()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 C° + 10")]
+ [Test]
public void AddTemperatureAndNumber()
{
var add = new Add(
@@ -137,7 +137,7 @@ public void AddTemperatureAndNumber()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 C° + 10 K")]
+ [Test]
public void AddTwoTemperatures()
{
var add = new Add(
@@ -149,7 +149,7 @@ public void AddTwoTemperatures()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 + 10 g")]
+ [Test]
public void AddNumberAndMass()
{
var add = new Add(
@@ -161,7 +161,7 @@ public void AddNumberAndMass()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 g + 10")]
+ [Test]
public void AddMassAndNumber()
{
var add = new Add(
@@ -173,7 +173,7 @@ public void AddMassAndNumber()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 g + 10 kg")]
+ [Test]
public void AddTwoMasses()
{
var add = new Add(
@@ -185,7 +185,7 @@ public void AddTwoMasses()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 + 10 m")]
+ [Test]
public void AddNumberAndLength()
{
var add = new Add(
@@ -197,7 +197,7 @@ public void AddNumberAndLength()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 m + 10")]
+ [Test]
public void AddLengthAndNumber()
{
var add = new Add(
@@ -209,7 +209,7 @@ public void AddLengthAndNumber()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 km + 10 m")]
+ [Test]
public void AddTwoLengths()
{
var add = new Add(
@@ -221,7 +221,7 @@ public void AddTwoLengths()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 + 10 s")]
+ [Test]
public void AddNumberAndTime()
{
var add = new Add(
@@ -233,7 +233,7 @@ public void AddNumberAndTime()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 s + 10")]
+ [Test]
public void AddTimeAndNumber()
{
var add = new Add(
@@ -245,7 +245,7 @@ public void AddTimeAndNumber()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 min + 10 s")]
+ [Test]
public void AddTwoTimeValues()
{
var add = new Add(
@@ -257,7 +257,7 @@ public void AddTwoTimeValues()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 + 10 m^2")]
+ [Test]
public void AddNumberAndArea()
{
var add = new Add(
@@ -269,7 +269,7 @@ public void AddNumberAndArea()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 m^2 + 10")]
+ [Test]
public void AddAreaAndNumber()
{
var add = new Add(
@@ -281,7 +281,7 @@ public void AddAreaAndNumber()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 km^2 + 500000 m^2")]
+ [Test]
public void AddTwoAreaValues()
{
var add = new Add(
@@ -293,7 +293,7 @@ public void AddTwoAreaValues()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 + 10 m^3")]
+ [Test]
public void AddNumberAndVolume()
{
var add = new Add(
@@ -305,7 +305,7 @@ public void AddNumberAndVolume()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "10 m^3 + 10")]
+ [Test]
public void AddVolumeAndNumber()
{
var add = new Add(
@@ -317,7 +317,7 @@ public void AddVolumeAndNumber()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "1 m^3 + 500000 cm^3")]
+ [Test]
public void AddTwoVolumeValues()
{
var add = new Add(
@@ -329,7 +329,7 @@ public void AddTwoVolumeValues()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "-x + 2")]
+ [Test]
public void AddFirstUnaryMinus()
{
var add = new Add(new UnaryMinus(Variable.X), Number.Two);
@@ -338,7 +338,7 @@ public void AddFirstUnaryMinus()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "2 + (-x)")]
+ [Test]
public void AddSecondUnaryMinus()
{
var add = new Add(Number.Two, new UnaryMinus(Variable.X));
@@ -347,7 +347,7 @@ public void AddSecondUnaryMinus()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "2 + (2 + x)")]
+ [Test]
public void AddDiffNumAdd_NumAddVar_()
{
var add = new Add(Number.Two, new Add(Number.Two, Variable.X));
@@ -356,7 +356,7 @@ public void AddDiffNumAdd_NumAddVar_()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "2 + (x + 2)")]
+ [Test]
public void AddDiffNumAdd_VarAddNum_()
{
var add = new Add(Number.Two, new Add(Variable.X, Number.Two));
@@ -365,7 +365,7 @@ public void AddDiffNumAdd_VarAddNum_()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "(2 + x) + 2")]
+ [Test]
public void AddDiff_NumAddVar_AddNum()
{
var add = new Add(new Add(Number.Two, Variable.X), Number.Two);
@@ -374,7 +374,7 @@ public void AddDiff_NumAddVar_AddNum()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "(x + 2) + 2")]
+ [Test]
public void AddDiff_VarAddNum_AddNum()
{
var add = new Add(new Add(Variable.X, Number.Two), Number.Two);
@@ -383,7 +383,7 @@ public void AddDiff_VarAddNum_AddNum()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "2 + (2 - x)")]
+ [Test]
public void AddDiffNum_NumSubVar_()
{
var add = new Add(Number.Two, new Sub(Number.Two, Variable.X));
@@ -392,7 +392,7 @@ public void AddDiffNum_NumSubVar_()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "2 + (x - 2)")]
+ [Test]
public void AddDiffNum_VarSubNum_()
{
var add = new Add(Number.Two, new Sub(Variable.X, Number.Two));
@@ -401,7 +401,7 @@ public void AddDiffNum_VarSubNum_()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "(2 - x) + 2")]
+ [Test]
public void AddDiff_NumSubVar_AddNum()
{
var add = new Add(new Sub(Number.Two, Variable.X), Number.Two);
@@ -410,7 +410,7 @@ public void AddDiff_NumSubVar_AddNum()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "(x - 2) + 2")]
+ [Test]
public void AddDiff_VarSubNum_AddNum()
{
var add = new Add(new Sub(Variable.X, Number.Two), Number.Two);
@@ -419,7 +419,7 @@ public void AddDiff_VarSubNum_AddNum()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "x + x")]
+ [Test]
public void AddSaveVars1()
{
var exp = new Add(Variable.X, Variable.X);
@@ -428,7 +428,7 @@ public void AddSaveVars1()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "2x + x")]
+ [Test]
public void AddSaveVars2()
{
var exp = new Add(new Mul(Number.Two, Variable.X), Variable.X);
@@ -437,7 +437,7 @@ public void AddSaveVars2()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "2 * (x + y) + (x + y)")]
+ [Test]
public void AddComplexX()
{
var exp = new Add(
@@ -448,7 +448,7 @@ public void AddComplexX()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "x + 2x")]
+ [Test]
public void AddSaveVars3()
{
var exp = new Add(Variable.X, new Mul(Number.Two, Variable.X));
@@ -457,7 +457,7 @@ public void AddSaveVars3()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "x + x * 2")]
+ [Test]
public void AddSaveVars4()
{
var exp = new Add(Variable.X, new Mul(Variable.X, Number.Two));
@@ -466,7 +466,7 @@ public void AddSaveVars4()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "2x + 3x")]
+ [Test]
public void AddSaveVars5()
{
var exp = new Add(
@@ -478,7 +478,7 @@ public void AddSaveVars5()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "2 * (x + y) + 3 * (x + y)")]
+ [Test]
public void AddComplexX2()
{
var exp = new Add(
@@ -493,7 +493,7 @@ public void AddComplexX2()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "-x + x")]
+ [Test]
public void AddSaveVars6()
{
var exp = new Add(new UnaryMinus(Variable.X), Variable.X);
@@ -502,7 +502,7 @@ public void AddSaveVars6()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "-x + 2x")]
+ [Test]
public void AddSaveVars7()
{
var exp = new Add(
@@ -514,7 +514,7 @@ public void AddSaveVars7()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "x * 2 + x")]
+ [Test]
public void AddSaveVars8()
{
var exp = new Add(new Mul(Variable.X, Number.Two), Variable.X);
@@ -523,7 +523,7 @@ public void AddSaveVars8()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "x * 2 + x * 3")]
+ [Test]
public void AddSaveVars9()
{
var exp = new Add(
@@ -535,7 +535,7 @@ public void AddSaveVars9()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "3x + -2x")]
+ [Test]
public void AddSaveVars10()
{
var exp = new Add(
@@ -547,7 +547,7 @@ public void AddSaveVars10()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "3x + -4x")]
+ [Test]
public void AddSaveVars11()
{
var exp = new Add(
@@ -559,7 +559,7 @@ public void AddSaveVars11()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "-2x + x * 3")]
+ [Test]
public void AddSameVars12()
{
var exp = new Add(
@@ -571,7 +571,7 @@ public void AddSameVars12()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "x * 3 + -2x")]
+ [Test]
public void AddSameVars13()
{
var exp = new Add(
@@ -583,7 +583,7 @@ public void AddSameVars13()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void AddArgumentSimplified()
{
var exp = new Add(
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/AngleSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/AngleSimplifierTest.cs
index 1674b73c0..667b94ace 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/AngleSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/AngleSimplifierTest.cs
@@ -5,7 +5,7 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class AngleSimplifierTest : BaseSimplifierTest
{
- [Fact]
+ [Test]
public void ToDegreeNumber()
{
var exp = new ToDegree(new Number(10));
@@ -14,7 +14,7 @@ public void ToDegreeNumber()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void DegreeToDegree()
{
var exp = new ToDegree(AngleValue.Degree(10).AsExpression());
@@ -23,7 +23,7 @@ public void DegreeToDegree()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void RadianToDegree()
{
var exp = new ToDegree(AngleValue.Radian(Math.PI).AsExpression());
@@ -32,7 +32,7 @@ public void RadianToDegree()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ToDegreeArgumentSimplified()
{
var exp = new ToDegree(
@@ -45,7 +45,7 @@ public void ToDegreeArgumentSimplified()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ToDegreeNotSimplified()
{
var exp = new ToDegree(Variable.X);
@@ -53,7 +53,7 @@ public void ToDegreeNotSimplified()
SimplifyTest(exp, exp);
}
- [Fact]
+ [Test]
public void ToRadianNumber()
{
var exp = new ToRadian(new Number(10));
@@ -62,7 +62,7 @@ public void ToRadianNumber()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void RadianToRadian()
{
var exp = new ToRadian(AngleValue.Radian(10).AsExpression());
@@ -71,7 +71,7 @@ public void RadianToRadian()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void DegreeToRadian()
{
var exp = new ToRadian(AngleValue.Degree(180).AsExpression());
@@ -80,7 +80,7 @@ public void DegreeToRadian()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ToRadianArgumentSimplified()
{
var exp = new ToRadian(
@@ -93,7 +93,7 @@ public void ToRadianArgumentSimplified()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ToRadianNotSimplified()
{
var exp = new ToRadian(Variable.X);
@@ -101,7 +101,7 @@ public void ToRadianNotSimplified()
SimplifyTest(exp, exp);
}
- [Fact]
+ [Test]
public void ToGradianNumber()
{
var exp = new ToGradian(new Number(10));
@@ -110,7 +110,7 @@ public void ToGradianNumber()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void GradianToGradian()
{
var exp = new ToGradian(AngleValue.Gradian(10).AsExpression());
@@ -119,7 +119,7 @@ public void GradianToGradian()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void DegreeToGradian()
{
var exp = new ToGradian(AngleValue.Degree(180).AsExpression());
@@ -128,7 +128,7 @@ public void DegreeToGradian()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ToGradianArgumentSimplified()
{
var exp = new ToGradian(
@@ -141,7 +141,7 @@ public void ToGradianArgumentSimplified()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ToGradianNotSimplified()
{
var exp = new ToGradian(Variable.X);
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/BaseSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/BaseSimplifierTest.cs
index 1e0c3ddf2..4a8790223 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/BaseSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/BaseSimplifierTest.cs
@@ -2,7 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Reflection;
-using Xunit.Sdk;
+using NUnit.Framework.Internal;
namespace xFunc.Tests.Analyzers.SimplifierTests;
@@ -19,7 +19,7 @@ protected void SimplifyTest(IExpression exp, IExpression expected)
{
var simple = exp.Analyze(simplifier);
- Assert.Equal(expected, simple);
+ Assert.That(simple, Is.EqualTo(expected));
}
protected void TestNullExp(Type type)
@@ -38,6 +38,6 @@ protected void TestNullExp(Type type)
throw;
}
- throw new XunitException("The exception is expected.");
+ throw new NUnitException("The exception is expected.");
}
}
\ No newline at end of file
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/DivSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/DivSimplifierTest.cs
index b60ea0f5e..73a8382c3 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/DivSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/DivSimplifierTest.cs
@@ -5,7 +5,7 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class DivSimplifierTest : BaseSimplifierTest
{
- [Fact(DisplayName = "0 / x")]
+ [Test]
public void DivZero()
{
var div = new Div(Number.Zero, Variable.X);
@@ -14,7 +14,7 @@ public void DivZero()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "x / 0")]
+ [Test]
public void DivByZero()
{
var div = new Div(Variable.X, Number.Zero);
@@ -22,7 +22,7 @@ public void DivByZero()
Assert.Throws(() => SimplifyTest(div, null));
}
- [Fact(DisplayName = "0 / 0")]
+ [Test]
public void ZeroDivByZero()
{
var div = new Div(Number.Zero, Number.Zero);
@@ -31,7 +31,7 @@ public void ZeroDivByZero()
Assert.True(actual.Value.IsNaN);
}
- [Fact(DisplayName = "x / 1")]
+ [Test]
public void DivByOne()
{
var div = new Div(Variable.X, Number.One);
@@ -40,7 +40,7 @@ public void DivByOne()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "8 / 2")]
+ [Test]
public void DivTwoNumbers()
{
var div = new Div(new Number(8), Number.Two);
@@ -49,7 +49,7 @@ public void DivTwoNumbers()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "90 deg / 2")]
+ [Test]
public void DivAngleNumber()
{
var div = new Div(
@@ -61,7 +61,7 @@ public void DivAngleNumber()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "90 W / 2")]
+ [Test]
public void DivPowerByNumber()
{
var div = new Div(
@@ -73,7 +73,7 @@ public void DivPowerByNumber()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "90 C° / 2")]
+ [Test]
public void DivTemperatureByNumber()
{
var div = new Div(
@@ -85,7 +85,7 @@ public void DivTemperatureByNumber()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "90 g / 2")]
+ [Test]
public void DivMassByNumber()
{
var div = new Div(
@@ -97,7 +97,7 @@ public void DivMassByNumber()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "90 m / 2")]
+ [Test]
public void DivLengthByNumber()
{
var div = new Div(
@@ -109,7 +109,7 @@ public void DivLengthByNumber()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "90 s / 2")]
+ [Test]
public void DivTimeByNumber()
{
var div = new Div(
@@ -121,7 +121,7 @@ public void DivTimeByNumber()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "90 m^2 / 2")]
+ [Test]
public void DivAreaByNumber()
{
var div = new Div(
@@ -133,7 +133,7 @@ public void DivAreaByNumber()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "90 m^3 / 2")]
+ [Test]
public void DivVolumeByNumber()
{
var div = new Div(
@@ -145,7 +145,7 @@ public void DivVolumeByNumber()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "(2 * x) / 4")]
+ [Test]
public void DivDiff_NumMulVar_DivNum()
{
var div = new Div(new Mul(Number.Two, Variable.X), new Number(4));
@@ -154,7 +154,7 @@ public void DivDiff_NumMulVar_DivNum()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "(x * 2) / 4")]
+ [Test]
public void DivDiff_VarMulNum_DivNum()
{
var div = new Div(new Mul(Variable.X, Number.Two), new Number(4));
@@ -163,7 +163,7 @@ public void DivDiff_VarMulNum_DivNum()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "2 / (2 * x)")]
+ [Test]
public void DivDiffNumDiv_NumMulVar_()
{
var div = new Div(Number.Two, new Mul(Number.Two, Variable.X));
@@ -172,7 +172,7 @@ public void DivDiffNumDiv_NumMulVar_()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "2 / (2 * x)")]
+ [Test]
public void DivDiffNumDiv_VarMulNum_()
{
var div = new Div(Number.Two, new Mul(Variable.X, Number.Two));
@@ -181,7 +181,7 @@ public void DivDiffNumDiv_VarMulNum_()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "(2 / x) / 2")]
+ [Test]
public void DivDiff_NumDivVar_DivNum()
{
var div = new Div(new Div(Number.Two, Variable.X), Number.Two);
@@ -190,7 +190,7 @@ public void DivDiff_NumDivVar_DivNum()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "(x / 2) / 2")]
+ [Test]
public void DivDiff_VarDivNum_DivNum()
{
var div = new Div(new Div(Variable.X, Number.Two), Number.Two);
@@ -199,7 +199,7 @@ public void DivDiff_VarDivNum_DivNum()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "2 / (2 / x)")]
+ [Test]
public void DivDiffNumDiv_NumDivVar_()
{
var div = new Div(Number.Two, new Div(Number.Two, Variable.X));
@@ -208,7 +208,7 @@ public void DivDiffNumDiv_NumDivVar_()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "2 / (x / 2)")]
+ [Test]
public void DivDiffNumDiv_VarDivNum_()
{
var div = new Div(Number.Two, new Div(Variable.X, Number.Two));
@@ -217,7 +217,7 @@ public void DivDiffNumDiv_VarDivNum_()
SimplifyTest(div, expected);
}
- [Fact(DisplayName = "x / x")]
+ [Test]
public void DivSameVars()
{
var div = new Div(Variable.X, Variable.X);
@@ -226,7 +226,7 @@ public void DivSameVars()
SimplifyTest(div, expected);
}
- [Fact]
+ [Test]
public void DivArgumentSimplified()
{
var exp = new Div(
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/LogSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/LogSimplifierTest.cs
index 46d41b06d..41e8f7569 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/LogSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/LogSimplifierTest.cs
@@ -5,7 +5,7 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class LogSimplifierTest : BaseSimplifierTest
{
- [Fact]
+ [Test]
public void Log()
{
var log = new Log(Variable.X, Variable.X);
@@ -14,7 +14,7 @@ public void Log()
SimplifyTest(log, expected);
}
- [Fact]
+ [Test]
public void LogNotSimplified()
{
var log = new Log(new Number(3), new Number(11));
@@ -22,7 +22,7 @@ public void LogNotSimplified()
SimplifyTest(log, log);
}
- [Fact]
+ [Test]
public void LogArgumentSimplified()
{
var log = new Log(Variable.X, new Add(Number.One, Number.One));
@@ -31,7 +31,7 @@ public void LogArgumentSimplified()
SimplifyTest(log, expected);
}
- [Fact]
+ [Test]
public void Ln()
{
var ln = new Ln(new Variable("e"));
@@ -40,7 +40,7 @@ public void Ln()
SimplifyTest(ln, expected);
}
- [Fact]
+ [Test]
public void LnArgumentSimplified()
{
var log = new Ln(new Add(Number.Two, Number.Two));
@@ -49,7 +49,7 @@ public void LnArgumentSimplified()
SimplifyTest(log, expected);
}
- [Fact]
+ [Test]
public void LnNotSimplified()
{
var ln = new Ln(new Variable("z"));
@@ -57,7 +57,7 @@ public void LnNotSimplified()
SimplifyTest(ln, ln);
}
- [Fact]
+ [Test]
public void Lg()
{
var log = new Lg(new Number(10));
@@ -66,7 +66,7 @@ public void Lg()
SimplifyTest(log, expected);
}
- [Fact]
+ [Test]
public void LgArgumentSimplified()
{
var log = new Lg(new Add(Number.Two, Number.Two));
@@ -75,7 +75,7 @@ public void LgArgumentSimplified()
SimplifyTest(log, expected);
}
- [Fact]
+ [Test]
public void LgNotSimplified()
{
var log = new Lg(new Number(101));
@@ -83,7 +83,7 @@ public void LgNotSimplified()
SimplifyTest(log, log);
}
- [Fact]
+ [Test]
public void Lb()
{
var log = new Lb(Number.Two);
@@ -92,7 +92,7 @@ public void Lb()
SimplifyTest(log, expected);
}
- [Fact]
+ [Test]
public void LbArgumentSimplified()
{
var log = new Lb(new Add(Number.Two, Number.Two));
@@ -101,7 +101,7 @@ public void LbArgumentSimplified()
SimplifyTest(log, expected);
}
- [Fact]
+ [Test]
public void LbNotSimplified()
{
var log = new Lb(new Number(3));
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/MulSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/MulSimplifierTest.cs
index e2f33b51c..268560345 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/MulSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/MulSimplifierTest.cs
@@ -5,7 +5,7 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class MulSimplifierTest : BaseSimplifierTest
{
- [Fact(DisplayName = "x * 2")]
+ [Test]
public void Order1()
{
var add = new Mul(Variable.X, Number.Two);
@@ -14,7 +14,7 @@ public void Order1()
SimplifyTest(add, expected);
}
- [Fact(DisplayName = "0 * 10")]
+ [Test]
public void MulByFirstZero()
{
var mul = new Mul(Number.Zero, new Number(10));
@@ -23,7 +23,7 @@ public void MulByFirstZero()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * 0")]
+ [Test]
public void MulBySecondZero()
{
var mul = new Mul(new Number(10), Number.Zero);
@@ -32,7 +32,7 @@ public void MulBySecondZero()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "1 * 10")]
+ [Test]
public void MulFirstOne()
{
var mul = new Mul(Number.One, new Number(10));
@@ -41,7 +41,7 @@ public void MulFirstOne()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * 1")]
+ [Test]
public void MulSecondOne()
{
var mul = new Mul(new Number(10), Number.One);
@@ -50,7 +50,7 @@ public void MulSecondOne()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "-1 * 10")]
+ [Test]
public void MulFirstMinusOne()
{
var mul = new Mul(new Number(-1), new Number(10));
@@ -59,7 +59,7 @@ public void MulFirstMinusOne()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * -1")]
+ [Test]
public void MulSecondMinusOne()
{
var mul = new Mul(new Number(10), new Number(-1));
@@ -68,7 +68,7 @@ public void MulSecondMinusOne()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 * 3")]
+ [Test]
public void MulTwoNumbers()
{
var mul = new Mul(Number.Two, new Number(3));
@@ -77,7 +77,7 @@ public void MulTwoNumbers()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "90 * 2 deg")]
+ [Test]
public void MulNumberAngle()
{
var mul = new Mul(
@@ -89,7 +89,7 @@ public void MulNumberAngle()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "90 deg * 2")]
+ [Test]
public void MulAngleNumber()
{
var mul = new Mul(
@@ -101,7 +101,7 @@ public void MulAngleNumber()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * 2 W")]
+ [Test]
public void MulNumberByPower()
{
var mul = new Mul(
@@ -113,7 +113,7 @@ public void MulNumberByPower()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 W * 10")]
+ [Test]
public void MulPowerByNumber()
{
var mul = new Mul(
@@ -125,7 +125,7 @@ public void MulPowerByNumber()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * 2 C°")]
+ [Test]
public void MulNumberByTemperature()
{
var mul = new Mul(
@@ -137,7 +137,7 @@ public void MulNumberByTemperature()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 C° * 10")]
+ [Test]
public void MulTemperatureByNumber()
{
var mul = new Mul(
@@ -149,7 +149,7 @@ public void MulTemperatureByNumber()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * 2 g")]
+ [Test]
public void MulNumberByMass()
{
var mul = new Mul(
@@ -161,7 +161,7 @@ public void MulNumberByMass()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 g * 10")]
+ [Test]
public void MulMassByNumber()
{
var mul = new Mul(
@@ -173,7 +173,7 @@ public void MulMassByNumber()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * 2 m")]
+ [Test]
public void MulNumberByLength()
{
var mul = new Mul(
@@ -185,7 +185,7 @@ public void MulNumberByLength()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 m * 10")]
+ [Test]
public void MulLengthByNumber()
{
var mul = new Mul(
@@ -197,7 +197,7 @@ public void MulLengthByNumber()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 m * 2 m")]
+ [Test]
public void MulLengthByLength()
{
var mul = new Mul(
@@ -209,7 +209,7 @@ public void MulLengthByLength()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 m^2 * 2 m")]
+ [Test]
public void MulAreaByLength()
{
var mul = new Mul(
@@ -221,7 +221,7 @@ public void MulAreaByLength()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 m * 2 m^2")]
+ [Test]
public void MulLengthByArea()
{
var mul = new Mul(
@@ -233,7 +233,7 @@ public void MulLengthByArea()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * 2 s")]
+ [Test]
public void MulNumberByTime()
{
var mul = new Mul(
@@ -245,7 +245,7 @@ public void MulNumberByTime()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 s * 10")]
+ [Test]
public void MulTimeByNumber()
{
var mul = new Mul(
@@ -257,7 +257,7 @@ public void MulTimeByNumber()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * 2 m^2")]
+ [Test]
public void MulNumberByArea()
{
var mul = new Mul(
@@ -269,7 +269,7 @@ public void MulNumberByArea()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 m^2 * 10")]
+ [Test]
public void MulAreaByNumber()
{
var mul = new Mul(
@@ -281,7 +281,7 @@ public void MulAreaByNumber()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "10 * 2 m^3")]
+ [Test]
public void MulNumberByVolume()
{
var mul = new Mul(
@@ -293,7 +293,7 @@ public void MulNumberByVolume()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 m^3 * 10")]
+ [Test]
public void MulVolumeByNumber()
{
var mul = new Mul(
@@ -305,7 +305,7 @@ public void MulVolumeByNumber()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 * (2 * x)")]
+ [Test]
public void MulDiffNumMul_NumMulVar_()
{
var mul = new Mul(Number.Two, new Mul(Number.Two, Variable.X));
@@ -314,7 +314,7 @@ public void MulDiffNumMul_NumMulVar_()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 * (x * 2)")]
+ [Test]
public void MulDiffNumMul_VarMulNum_()
{
var mul = new Mul(Number.Two, new Mul(Variable.X, Number.Two));
@@ -323,7 +323,7 @@ public void MulDiffNumMul_VarMulNum_()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "(2 * x) * 2")]
+ [Test]
public void MulDiff_NumMulVar_MulNum()
{
var mul = new Mul(new Mul(Number.Two, Variable.X), Number.Two);
@@ -332,7 +332,7 @@ public void MulDiff_NumMulVar_MulNum()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "(x * 2) * 2")]
+ [Test]
public void MulDiff_VarMulNum_MulNum()
{
var mul = new Mul(new Mul(Variable.X, Number.Two), Number.Two);
@@ -341,7 +341,7 @@ public void MulDiff_VarMulNum_MulNum()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 * (2 / x)")]
+ [Test]
public void MulDiffNumMul_NumDivVar_()
{
var mul = new Mul(Number.Two, new Div(Number.Two, Variable.X));
@@ -350,7 +350,7 @@ public void MulDiffNumMul_NumDivVar_()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 * (x / 2)")]
+ [Test]
public void MulDiffNumMul_VarDivNum_()
{
var mul = new Mul(Number.Two, new Div(Variable.X, Number.Two));
@@ -359,7 +359,7 @@ public void MulDiffNumMul_VarDivNum_()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "(2 / x) * 2")]
+ [Test]
public void MulDiff_NumDivVar_MulNum()
{
var mul = new Mul(new Div(Number.Two, Variable.X), Number.Two);
@@ -368,7 +368,7 @@ public void MulDiff_NumDivVar_MulNum()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "(x / 2) * 2")]
+ [Test]
public void MulDiff_VarDivNum_MulNum()
{
var mul = new Mul(new Div(Variable.X, Number.Two), Number.Two);
@@ -377,7 +377,7 @@ public void MulDiff_VarDivNum_MulNum()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "x * x")]
+ [Test]
public void MulSameVar1()
{
var mul = new Mul(Variable.X, Variable.X);
@@ -386,7 +386,7 @@ public void MulSameVar1()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2x * x")]
+ [Test]
public void MulSameVar2()
{
var mul = new Mul(new Mul(Number.Two, Variable.X), Variable.X);
@@ -395,7 +395,7 @@ public void MulSameVar2()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 * (x + y) * (x + y)")]
+ [Test]
public void MulComplexX()
{
var mul = new Mul(
@@ -410,7 +410,7 @@ public void MulComplexX()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2x * 3x")]
+ [Test]
public void MulSameVar3()
{
var mul = new Mul(
@@ -422,7 +422,7 @@ public void MulSameVar3()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2 * (x + y) * 3 * (x + y)")]
+ [Test]
public void MulComplexX2()
{
var mul = new Mul(
@@ -437,7 +437,7 @@ public void MulComplexX2()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "x * 2x")]
+ [Test]
public void MulSameVar4()
{
var mul = new Mul(Variable.X, new Mul(Number.Two, Variable.X));
@@ -446,7 +446,7 @@ public void MulSameVar4()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "x * (x * 2)")]
+ [Test]
public void MulSameVar5()
{
var mul = new Mul(Variable.X, new Mul(Variable.X, Number.Two));
@@ -455,7 +455,7 @@ public void MulSameVar5()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2x * x")]
+ [Test]
public void MulSameVar6()
{
var mul = new Mul(new Mul(Number.Two, Variable.X), Variable.X);
@@ -464,7 +464,7 @@ public void MulSameVar6()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "(x * 2) * x")]
+ [Test]
public void MulSameVar7()
{
var mul = new Mul(new Mul(Variable.X, Number.Two), Variable.X);
@@ -473,7 +473,7 @@ public void MulSameVar7()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2x * 3x")]
+ [Test]
public void MulSameVar8()
{
var mul = new Mul(
@@ -485,7 +485,7 @@ public void MulSameVar8()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "(x * 2) * (x * 3)")]
+ [Test]
public void MulSameVar9()
{
var mul = new Mul(
@@ -497,7 +497,7 @@ public void MulSameVar9()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2x * -2x")]
+ [Test]
public void MulSameVar10()
{
var mul = new Mul(
@@ -509,7 +509,7 @@ public void MulSameVar10()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2x * -3x")]
+ [Test]
public void MulSameVar11()
{
var mul = new Mul(
@@ -521,7 +521,7 @@ public void MulSameVar11()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "2x * x * (-3)")]
+ [Test]
public void MulSameVar12()
{
var mul = new Mul(
@@ -533,7 +533,7 @@ public void MulSameVar12()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "x * 2 * -3x")]
+ [Test]
public void MulSameVar13()
{
var mul = new Mul(
@@ -545,7 +545,7 @@ public void MulSameVar13()
SimplifyTest(mul, expected);
}
- [Fact(DisplayName = "cos(cos(x)) * -sin(x)")]
+ [Test]
public void MulNegativeRightParamTest1()
{
var mul = new Mul(
@@ -560,7 +560,7 @@ public void MulNegativeRightParamTest1()
SimplifyTest(mul, expected);
}
- [Fact]
+ [Test]
public void MulArgumentSimplified()
{
var exp = new Mul(
@@ -572,7 +572,7 @@ public void MulArgumentSimplified()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "x * (1 / x)")]
+ [Test]
public void MulDiv1()
{
var exp = new Mul(
@@ -584,7 +584,7 @@ public void MulDiv1()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "(2 * x) * (1 / x)")]
+ [Test]
public void MulDiv2()
{
var exp = new Mul(
@@ -596,7 +596,7 @@ public void MulDiv2()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "(x * 2) * (1 / x)")]
+ [Test]
public void MulDiv3()
{
var exp = new Mul(
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/PowerSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/PowerSimplifierTest.cs
index 87a4bd681..616d55e2d 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/PowerSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/PowerSimplifierTest.cs
@@ -5,7 +5,7 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class PowerSimplifierTest : BaseSimplifierTest
{
- [Fact]
+ [Test]
public void PowerXZero()
{
var pow = new Pow(Variable.X, Number.Zero);
@@ -14,7 +14,7 @@ public void PowerXZero()
SimplifyTest(pow, expected);
}
- [Fact]
+ [Test]
public void PowerZeroX()
{
var pow = new Pow(Number.Zero, Variable.X);
@@ -23,7 +23,7 @@ public void PowerZeroX()
SimplifyTest(pow, expected);
}
- [Fact]
+ [Test]
public void PowerOne()
{
var pow = new Pow(Variable.X, Number.One);
@@ -32,7 +32,7 @@ public void PowerOne()
SimplifyTest(pow, expected);
}
- [Fact]
+ [Test]
public void PowerArgumentSimplified()
{
var pow = new Pow(Variable.X, new Add(Number.One, Number.One));
@@ -41,7 +41,7 @@ public void PowerArgumentSimplified()
SimplifyTest(pow, expected);
}
- [Fact]
+ [Test]
public void PowerNotSimplified()
{
var pow = new Pow(Variable.X, Variable.X);
@@ -49,7 +49,7 @@ public void PowerNotSimplified()
SimplifyTest(pow, pow);
}
- [Fact]
+ [Test]
public void PowLog()
{
var pow = new Pow(
@@ -60,7 +60,7 @@ public void PowLog()
SimplifyTest(pow, expected);
}
- [Fact]
+ [Test]
public void PowLg()
{
var pow = new Pow(
@@ -71,7 +71,7 @@ public void PowLg()
SimplifyTest(pow, expected);
}
- [Fact]
+ [Test]
public void PowLn()
{
var pow = new Pow(
@@ -82,7 +82,7 @@ public void PowLn()
SimplifyTest(pow, expected);
}
- [Fact]
+ [Test]
public void PowLb()
{
var pow = new Pow(
@@ -93,7 +93,7 @@ public void PowLb()
SimplifyTest(pow, expected);
}
- [Fact]
+ [Test]
public void RootOne()
{
var root = new Root(Variable.X, Number.One);
@@ -102,7 +102,7 @@ public void RootOne()
SimplifyTest(root, expected);
}
- [Fact]
+ [Test]
public void RootArgumentSimplified()
{
var root = new Root(Variable.X, new Add(Number.One, Number.One));
@@ -111,7 +111,7 @@ public void RootArgumentSimplified()
SimplifyTest(root, expected);
}
- [Fact]
+ [Test]
public void RootNotSimplified()
{
var root = new Root(Variable.X, new Number(5));
@@ -119,7 +119,7 @@ public void RootNotSimplified()
SimplifyTest(root, root);
}
- [Fact]
+ [Test]
public void Exp()
{
var exp = new Exp(new Number(30));
@@ -127,7 +127,7 @@ public void Exp()
SimplifyTest(exp, exp);
}
- [Fact]
+ [Test]
public void ExpLn()
{
var exp = new Exp(new Ln(new Number(30)));
@@ -136,7 +136,7 @@ public void ExpLn()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ExpArgumentSimplified()
{
var exp = new Exp(new Add(Number.One, Number.One));
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/SimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/SimplifierTest.cs
index 18c48f882..5bd9c7204 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/SimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/SimplifierTest.cs
@@ -7,7 +7,7 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class SimplifierTest : BaseSimplifierTest
{
- [Fact]
+ [Test]
public void DoubleUnary()
{
var un = new UnaryMinus(new UnaryMinus(Variable.X));
@@ -16,7 +16,7 @@ public void DoubleUnary()
SimplifyTest(un, expected);
}
- [Fact]
+ [Test]
public void UnaryNumber()
{
var un = new UnaryMinus(Number.One);
@@ -25,7 +25,7 @@ public void UnaryNumber()
SimplifyTest(un, expected);
}
- [Fact]
+ [Test]
public void UnaryNumberArgumentSimplified()
{
var un = new UnaryMinus(
@@ -38,7 +38,7 @@ public void UnaryNumberArgumentSimplified()
SimplifyTest(un, expected);
}
- [Fact]
+ [Test]
public void UnaryNumberNotSimplified()
{
var un = new UnaryMinus(Variable.X);
@@ -46,7 +46,7 @@ public void UnaryNumberNotSimplified()
SimplifyTest(un, un);
}
- [Fact]
+ [Test]
public void Define()
{
var define = new Assign(Variable.X, new Add(Number.Two, Number.Two));
@@ -55,7 +55,7 @@ public void Define()
SimplifyTest(define, expected);
}
- [Fact]
+ [Test]
public void DefineNotSimplifierTest()
{
var define = new Assign(Variable.X, Number.Two);
@@ -63,7 +63,7 @@ public void DefineNotSimplifierTest()
SimplifyTest(define, define);
}
- [Fact]
+ [Test]
public void Simplify()
{
var simp = new Simplify(simplifier, new Pow(Variable.X, Number.Zero));
@@ -72,7 +72,7 @@ public void Simplify()
SimplifyTest(simp, expected);
}
- [Fact]
+ [Test]
public void Deriv()
{
var diff = new Differentiator();
@@ -83,7 +83,7 @@ public void Deriv()
SimplifyTest(simp, expected);
}
- [Fact]
+ [Test]
public void DerivNotSimplifiedTest()
{
var differentiator = new Differentiator();
@@ -93,7 +93,7 @@ public void DerivNotSimplifiedTest()
SimplifyTest(exp, exp);
}
- [Fact]
+ [Test]
public void DiffTest()
{
var exp = new Count(new IExpression[] { new Add(Number.Two, Number.Two) });
@@ -102,7 +102,7 @@ public void DiffTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void UnaryMinusNumberTest()
{
var exp = new Abs(new UnaryMinus(Variable.X));
@@ -111,7 +111,7 @@ public void UnaryMinusNumberTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void AbsAbsTest()
{
var exp = new Abs(new Abs(Variable.X));
@@ -120,7 +120,7 @@ public void AbsAbsTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void AbsAbsAbsTest()
{
var exp = new Abs(new Abs(new Abs(Variable.X)));
@@ -129,7 +129,7 @@ public void AbsAbsAbsTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void AbsArgumentSimplifiedTest()
{
var exp = new Abs(new Add(Number.One, Number.One));
@@ -138,7 +138,7 @@ public void AbsArgumentSimplifiedTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void MatrixTest()
{
var exp = new Matrix(new[]
@@ -159,7 +159,7 @@ public void MatrixTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void MatrixNotSimplifiedTest()
{
var exp = new Matrix(new[]
@@ -170,7 +170,7 @@ public void MatrixNotSimplifiedTest()
SimplifyTest(exp, exp);
}
- [Fact]
+ [Test]
public void AddAssignTest()
{
var exp = new AddAssign(Variable.X, new Add(Number.One, Number.Two));
@@ -179,7 +179,7 @@ public void AddAssignTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void AddAssignNotSimplifiedTest()
{
var exp = new AddAssign(Variable.X, Number.One);
@@ -187,7 +187,7 @@ public void AddAssignNotSimplifiedTest()
SimplifyTest(exp, exp);
}
- [Fact]
+ [Test]
public void CeilArgumentSimplifiedTest()
{
var exp = new Ceil(new Add(Number.One, Number.One));
@@ -196,7 +196,7 @@ public void CeilArgumentSimplifiedTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void CeilNotSimplifiedTest()
{
var exp = new Ceil(Number.One);
@@ -204,7 +204,7 @@ public void CeilNotSimplifiedTest()
SimplifyTest(exp, exp);
}
- [Fact]
+ [Test]
public void ModLeftSimplifiedTest()
{
var exp = new Mod(new Add(Number.One, Number.One), Number.One);
@@ -213,7 +213,7 @@ public void ModLeftSimplifiedTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ModRightSimplifiedTest()
{
var exp = new Mod(Number.One, new Add(Number.One, Number.One));
@@ -222,7 +222,7 @@ public void ModRightSimplifiedTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ModNotSimplifiedTest()
{
var exp = new Mod(Number.One, Number.One);
@@ -230,7 +230,7 @@ public void ModNotSimplifiedTest()
SimplifyTest(exp, exp);
}
- [Fact]
+ [Test]
public void CallExpressionSimplifiedTest()
{
var exp = new CallExpression(
@@ -243,7 +243,7 @@ public void CallExpressionSimplifiedTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void CallExpressionNotSimplifiedTest()
{
var exp = new CallExpression(
@@ -253,7 +253,7 @@ public void CallExpressionNotSimplifiedTest()
SimplifyTest(exp, exp);
}
- [Fact]
+ [Test]
public void LambdaExpressionSimplifiedTest()
{
var exp = new Lambda(new[] { "x" }, new Add(Variable.X, Number.Zero)).AsExpression();
@@ -262,7 +262,7 @@ public void LambdaExpressionSimplifiedTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void LambdaExpressionNotSimplifiedTest()
{
var exp = new Lambda(new[] { "x" }, Variable.X).AsExpression();
@@ -270,11 +270,11 @@ public void LambdaExpressionNotSimplifiedTest()
SimplifyTest(exp, exp);
}
- [Theory]
- [ClassData(typeof(AllExpressionsData))]
+ [Test]
+ [TestCaseSource(typeof(AllExpressionsData))]
public void TestNullException(Type type) => TestNullExp(type);
- [Fact]
+ [Test]
public void MulOrderingTest()
{
// 2 * (1 * (3 * (x ^ (3 - 1))))
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/SubSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/SubSimplifierTest.cs
index 12d17a137..feb5c047c 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/SubSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/SubSimplifierTest.cs
@@ -5,7 +5,7 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class SubSimplifierTest : BaseSimplifierTest
{
- [Fact(DisplayName = "0 - x")]
+ [Test]
public void SubFirstZero()
{
var sub = new Sub(Number.Zero, Variable.X);
@@ -14,7 +14,7 @@ public void SubFirstZero()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "x - 0")]
+ [Test]
public void SubSecondZero()
{
var sub = new Sub(Variable.X, Number.Zero);
@@ -23,7 +23,7 @@ public void SubSecondZero()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "3 - 2")]
+ [Test]
public void SubTwoNumbers()
{
var sub = new Sub(new Number(3), Number.Two);
@@ -32,7 +32,7 @@ public void SubTwoNumbers()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "90 - 2 deg")]
+ [Test]
public void SubNumberAngle()
{
var sub = new Sub(
@@ -44,7 +44,7 @@ public void SubNumberAngle()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "90 deg - 2")]
+ [Test]
public void SubAngleNumber()
{
var sub = new Sub(
@@ -56,7 +56,7 @@ public void SubAngleNumber()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "2 rad - 90 deg")]
+ [Test]
public void SubTwoAngles()
{
var sub = new Sub(
@@ -68,7 +68,7 @@ public void SubTwoAngles()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 - 10 W")]
+ [Test]
public void SubPowerFromNumber()
{
var sub = new Sub(
@@ -80,7 +80,7 @@ public void SubPowerFromNumber()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 W - 10")]
+ [Test]
public void SubNumberFromPower()
{
var sub = new Sub(
@@ -92,7 +92,7 @@ public void SubNumberFromPower()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 kW - 10 W")]
+ [Test]
public void SubPowerFromPower()
{
var sub = new Sub(
@@ -104,7 +104,7 @@ public void SubPowerFromPower()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 - 10 C°")]
+ [Test]
public void SubTemperatureFromNumber()
{
var sub = new Sub(
@@ -116,7 +116,7 @@ public void SubTemperatureFromNumber()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 C° - 10")]
+ [Test]
public void SubNumberFromTemperature()
{
var sub = new Sub(
@@ -128,7 +128,7 @@ public void SubNumberFromTemperature()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 K - 10 C°")]
+ [Test]
public void SubTemperatureFromTemperature()
{
var sub = new Sub(
@@ -140,7 +140,7 @@ public void SubTemperatureFromTemperature()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 - 10 g")]
+ [Test]
public void SubMassFromNumber()
{
var sub = new Sub(
@@ -152,7 +152,7 @@ public void SubMassFromNumber()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 g - 10")]
+ [Test]
public void SubNumberFromMass()
{
var sub = new Sub(
@@ -164,7 +164,7 @@ public void SubNumberFromMass()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 kg - 10 g")]
+ [Test]
public void SubMassFromMass()
{
var sub = new Sub(
@@ -176,7 +176,7 @@ public void SubMassFromMass()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 - 10 m")]
+ [Test]
public void SubLengthFromNumber()
{
var sub = new Sub(
@@ -188,7 +188,7 @@ public void SubLengthFromNumber()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 m - 10")]
+ [Test]
public void SubNumberFromLength()
{
var sub = new Sub(
@@ -200,7 +200,7 @@ public void SubNumberFromLength()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 km - 10 m")]
+ [Test]
public void SubLengthFromLength()
{
var sub = new Sub(
@@ -212,7 +212,7 @@ public void SubLengthFromLength()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 - 10 s")]
+ [Test]
public void SubTimeFromNumber()
{
var sub = new Sub(
@@ -224,7 +224,7 @@ public void SubTimeFromNumber()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 s - 10")]
+ [Test]
public void SubNumberFromTime()
{
var sub = new Sub(
@@ -236,7 +236,7 @@ public void SubNumberFromTime()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 min - 10 s")]
+ [Test]
public void SubTimeFromTime()
{
var sub = new Sub(
@@ -248,7 +248,7 @@ public void SubTimeFromTime()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 - 10 m^2")]
+ [Test]
public void SubAreaFromNumber()
{
var sub = new Sub(
@@ -260,7 +260,7 @@ public void SubAreaFromNumber()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 m^2 - 10")]
+ [Test]
public void SubNumberFromArea()
{
var sub = new Sub(
@@ -272,7 +272,7 @@ public void SubNumberFromArea()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 km^2 - 10 m^2")]
+ [Test]
public void SubAreaFromArea()
{
var sub = new Sub(
@@ -284,7 +284,7 @@ public void SubAreaFromArea()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 - 10 m^3")]
+ [Test]
public void SubVolumeFromNumber()
{
var sub = new Sub(
@@ -296,7 +296,7 @@ public void SubVolumeFromNumber()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 m^3 - 10")]
+ [Test]
public void SubNumberFromVolume()
{
var sub = new Sub(
@@ -308,7 +308,7 @@ public void SubNumberFromVolume()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "20 m^3 - 10 cm^3")]
+ [Test]
public void SubVolumeAndVolume()
{
var sub = new Sub(
@@ -320,7 +320,7 @@ public void SubVolumeAndVolume()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "2 - -x")]
+ [Test]
public void SubSecondUnaryMinus()
{
var sub = new Sub(Number.Two, new UnaryMinus(Variable.X));
@@ -329,7 +329,7 @@ public void SubSecondUnaryMinus()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "(2 + x) - 2")]
+ [Test]
public void SubDiff_NumAddVar_SubNum()
{
var sub = new Sub(new Add(Number.Two, Variable.X), Number.Two);
@@ -338,7 +338,7 @@ public void SubDiff_NumAddVar_SubNum()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "(x + 2) - 2")]
+ [Test]
public void SubDiff_VarAddNum_SubNum()
{
var sub = new Sub(new Add(Variable.X, Number.Two), Number.Two);
@@ -347,7 +347,7 @@ public void SubDiff_VarAddNum_SubNum()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "2 - (2 + x)")]
+ [Test]
public void SubDiffNumSub_NumAddVar_()
{
var sub = new Sub(Number.Two, new Add(Number.Two, Variable.X));
@@ -356,7 +356,7 @@ public void SubDiffNumSub_NumAddVar_()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "2 - (x + 2)")]
+ [Test]
public void SubDiffNumSub_VarAddNum_()
{
var sub = new Sub(Number.Two, new Add(Variable.X, Number.Two));
@@ -365,7 +365,7 @@ public void SubDiffNumSub_VarAddNum_()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "(2 - x) - 2")]
+ [Test]
public void SubDiff_NumSubVar_SubNum()
{
var sub = new Sub(new Sub(Number.Two, Variable.X), Number.Two);
@@ -374,7 +374,7 @@ public void SubDiff_NumSubVar_SubNum()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "(x - 2) - 2")]
+ [Test]
public void SubDiff_VarSubNum_SubNum()
{
var sub = new Sub(new Sub(Variable.X, Number.Two), Number.Two);
@@ -383,7 +383,7 @@ public void SubDiff_VarSubNum_SubNum()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "2 - (2 - x)")]
+ [Test]
public void SubDiffNumSub_NumSubVar_()
{
var sub = new Sub(Number.Two, new Sub(Number.Two, Variable.X));
@@ -392,7 +392,7 @@ public void SubDiffNumSub_NumSubVar_()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "2 - (x - 2)")]
+ [Test]
public void SubDiffNumSub_VarSubNum_()
{
var sub = new Sub(Number.Two, new Sub(Variable.X, Number.Two));
@@ -401,7 +401,7 @@ public void SubDiffNumSub_VarSubNum_()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "x - x")]
+ [Test]
public void SubSameVars1()
{
var sub = new Sub(Variable.X, Variable.X);
@@ -410,7 +410,7 @@ public void SubSameVars1()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "(x - x) - x")]
+ [Test]
public void SubSameVars2()
{
var sub = new Sub(new Sub(Variable.X, Variable.X), Variable.X);
@@ -419,7 +419,7 @@ public void SubSameVars2()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "2x - x")]
+ [Test]
public void SubSameVars3()
{
var sub = new Sub(new Mul(Number.Two, Variable.X), Variable.X);
@@ -428,7 +428,7 @@ public void SubSameVars3()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "x - 2x")]
+ [Test]
public void SubSameVars4()
{
var sub = new Sub(Variable.X, new Mul(Number.Two, Variable.X));
@@ -437,7 +437,7 @@ public void SubSameVars4()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "(x + y) - 2 * (x + y)")]
+ [Test]
public void SubComplexX()
{
var sub = new Sub(
@@ -449,7 +449,7 @@ public void SubComplexX()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "x - (x * 2)")]
+ [Test]
public void SubSameVars5()
{
var sub = new Sub(Variable.X, new Mul(Variable.X, Number.Two));
@@ -458,7 +458,7 @@ public void SubSameVars5()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "2 * (x + y) - (x + y)")]
+ [Test]
public void SubComplexX2()
{
var sub = new Sub(
@@ -470,7 +470,7 @@ public void SubComplexX2()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "2x - x")]
+ [Test]
public void SubSameVars6()
{
var sub = new Sub(new Mul(Number.Two, Variable.X), Variable.X);
@@ -479,7 +479,7 @@ public void SubSameVars6()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "(x * 2) - x")]
+ [Test]
public void SubSameVars7()
{
var sub = new Sub(new Mul(Variable.X, Number.Two), Variable.X);
@@ -488,7 +488,7 @@ public void SubSameVars7()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "3x - 2x")]
+ [Test]
public void SubSameVars8()
{
var sub = new Sub(
@@ -500,7 +500,7 @@ public void SubSameVars8()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "3 * (x + y) - 2 * (x + y)")]
+ [Test]
public void SubComplexX3()
{
var sub = new Sub(
@@ -512,7 +512,7 @@ public void SubComplexX3()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "(x * 3) - (x * 2)")]
+ [Test]
public void SubSameVars9()
{
var sub = new Sub(
@@ -524,7 +524,7 @@ public void SubSameVars9()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "(x * 4) - (x * 2)")]
+ [Test]
public void SubSameVars10()
{
var sub = new Sub(
@@ -536,7 +536,7 @@ public void SubSameVars10()
SimplifyTest(sub, expected);
}
- [Fact(DisplayName = "3x - x * 2")]
+ [Test]
public void AddSameVars11()
{
var exp = new Sub(
@@ -548,7 +548,7 @@ public void AddSameVars11()
SimplifyTest(exp, expected);
}
- [Fact(DisplayName = "x * 3 - 2x")]
+ [Test]
public void AddSameVars12()
{
var exp = new Sub(
@@ -560,7 +560,7 @@ public void AddSameVars12()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void SubArgumentSimplified()
{
var exp = new Sub(
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/ToNumberSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/ToNumberSimplifierTest.cs
index c43feab4e..507845ed3 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/ToNumberSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/ToNumberSimplifierTest.cs
@@ -5,7 +5,7 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class ToNumberSimplifierTest : BaseSimplifierTest
{
- [Fact]
+ [Test]
public void AngleToNumberTest()
{
var exp = new ToNumber(AngleValue.Degree(10).AsExpression());
@@ -14,7 +14,7 @@ public void AngleToNumberTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void PowerToNumberTest()
{
var exp = new ToNumber(PowerValue.Watt(10).AsExpression());
@@ -23,7 +23,7 @@ public void PowerToNumberTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void TemperatureToNumberTest()
{
var exp = new ToNumber(TemperatureValue.Celsius(10).AsExpression());
@@ -32,7 +32,7 @@ public void TemperatureToNumberTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void MassToNumberTest()
{
var exp = new ToNumber(MassValue.Gram(10).AsExpression());
@@ -41,7 +41,7 @@ public void MassToNumberTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void LengthToNumberTest()
{
var exp = new ToNumber(LengthValue.Meter(10).AsExpression());
@@ -50,7 +50,7 @@ public void LengthToNumberTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void TimeToNumberTest()
{
var exp = new ToNumber(TimeValue.Second(10).AsExpression());
@@ -59,7 +59,7 @@ public void TimeToNumberTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void AreaToNumberTest()
{
var exp = new ToNumber(AreaValue.Meter(10).AsExpression());
@@ -68,7 +68,7 @@ public void AreaToNumberTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void VolumeToNumberTest()
{
var exp = new ToNumber(VolumeValue.Meter(10).AsExpression());
@@ -77,7 +77,7 @@ public void VolumeToNumberTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ToNumberArgumentSimplifiedTest()
{
var exp = new ToNumber(new Add(Number.One, Number.One));
@@ -86,7 +86,7 @@ public void ToNumberArgumentSimplifiedTest()
SimplifyTest(exp, expected);
}
- [Fact]
+ [Test]
public void ToNumberNotSimplifiedTest()
{
var exp = new ToNumber(Variable.X);
diff --git a/xFunc.Tests/Analyzers/SimplifierTests/TrigonometricSimplifierTest.cs b/xFunc.Tests/Analyzers/SimplifierTests/TrigonometricSimplifierTest.cs
index 25899bd9e..808cce38e 100644
--- a/xFunc.Tests/Analyzers/SimplifierTests/TrigonometricSimplifierTest.cs
+++ b/xFunc.Tests/Analyzers/SimplifierTests/TrigonometricSimplifierTest.cs
@@ -5,22 +5,22 @@ namespace xFunc.Tests.Analyzers.SimplifierTests;
public class TrigonometricSimplifierTest : BaseSimplifierTest
{
- [Theory]
- [InlineData(typeof(Arcsin), typeof(Sin))]
- [InlineData(typeof(Arccos), typeof(Cos))]
- [InlineData(typeof(Arctan), typeof(Tan))]
- [InlineData(typeof(Arccot), typeof(Cot))]
- [InlineData(typeof(Arcsec), typeof(Sec))]
- [InlineData(typeof(Arccsc), typeof(Csc))]
- [InlineData(typeof(Tan), typeof(Arctan))]
- [InlineData(typeof(Cot), typeof(Arccot))]
- [InlineData(typeof(Arsinh), typeof(Sinh))]
- [InlineData(typeof(Arcosh), typeof(Cosh))]
- [InlineData(typeof(Artanh), typeof(Tanh))]
- [InlineData(typeof(Arcoth), typeof(Coth))]
- [InlineData(typeof(Arsech), typeof(Sech))]
- [InlineData(typeof(Arcsch), typeof(Csch))]
- [InlineData(typeof(Sinh), typeof(Arsinh))]
+ [Test]
+ [TestCase(typeof(Arcsin), typeof(Sin))]
+ [TestCase(typeof(Arccos), typeof(Cos))]
+ [TestCase(typeof(Arctan), typeof(Tan))]
+ [TestCase(typeof(Arccot), typeof(Cot))]
+ [TestCase(typeof(Arcsec), typeof(Sec))]
+ [TestCase(typeof(Arccsc), typeof(Csc))]
+ [TestCase(typeof(Tan), typeof(Arctan))]
+ [TestCase(typeof(Cot), typeof(Arccot))]
+ [TestCase(typeof(Arsinh), typeof(Sinh))]
+ [TestCase(typeof(Arcosh), typeof(Cosh))]
+ [TestCase(typeof(Artanh), typeof(Tanh))]
+ [TestCase(typeof(Arcoth), typeof(Coth))]
+ [TestCase(typeof(Arsech), typeof(Sech))]
+ [TestCase(typeof(Arcsch), typeof(Csch))]
+ [TestCase(typeof(Sinh), typeof(Arsinh))]
public void InverseFunctionsTest(Type outer, Type inner)
{
var innerFunction = Create(inner, Variable.X);
@@ -85,24 +85,24 @@ public static IEnumerable