NUnit.Framework.Assert.AreEqual(double, double, double, string, params object[])

Here are the examples of the csharp api class NUnit.Framework.Assert.AreEqual(double, double, double, string, params object[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

23 Examples 7

1. Example

Project: 32feet
Source File: Assert.cs
View license
static public void AreEqual(double expected, 
			double actual, double delta, string message) 
		{
			Assert.AreEqual( expected, actual, delta, message, null );
		}

2. Example

Project: 32feet
Source File: Assert.cs
View license
static public void AreEqual(double expected, double actual, double delta) 
		{
			Assert.AreEqual(expected, actual, delta, string.Empty, null);
		}

3. Example

Project: 32feet
Source File: Assert.cs
View license
static public void AreEqual(double expected, 
			double actual, double delta, string message) 
		{
			Assert.AreEqual( expected, actual, delta, message, null );
		}

4. Example

Project: 32feet
Source File: Assert.cs
View license
static public void AreEqual(double expected, double actual, double delta) 
		{
			Assert.AreEqual(expected, actual, delta, string.Empty, null);
		}

5. Example

Project: mathnet-numerics
Source File: IntegrationTest.cs
View license
[TestCase(1e-5)]
        [TestCase(1e-13)]
        public void TestDoubleExponentialTransformationAlgorithm(double targetRelativeError)
        {
            Assert.AreEqual(
                TargetAreaA,
                DoubleExponentialTransformation.Integrate(TargetFunctionA, StartA, StopA, targetRelativeError),
                targetRelativeError * TargetAreaA,
                "DET Adaptive {0}",
                targetRelativeError);
        }

6. Example

Project: mathnet-numerics
Source File: IntegrationTest.cs
View license
[TestCase(1, 3.5e-1)]
        [TestCase(5, 1e-1)]
        [TestCase(10, 2e-2)]
        [TestCase(50, 6e-4)]
        [TestCase(1000, 1.5e-6)]
        public void TrapeziumRuleSupportsCompositeIntegration(int partitions, double maxRelativeError)
        {
            Assert.AreEqual(
                TargetAreaA,
                NewtonCotesTrapeziumRule.IntegrateComposite(TargetFunctionA, StartA, StopA, partitions),
                maxRelativeError * TargetAreaA,
                "Composite {0} Partitions",
                partitions);
        }

7. Example

Project: mathnet-numerics
Source File: IntegrationTest.cs
View license
[TestCase(1e-1)]
        [TestCase(1e-5)]
        [TestCase(1e-10)]
        public void TrapeziumRuleSupportsAdaptiveIntegration(double targetRelativeError)
        {
            Assert.AreEqual(
                TargetAreaA,
                NewtonCotesTrapeziumRule.IntegrateAdaptive(TargetFunctionA, StartA, StopA, targetRelativeError),
                targetRelativeError * TargetAreaA,
                "Adaptive {0}",
                targetRelativeError);
        }

8. Example

Project: mathnet-numerics
Source File: IntegrationTest.cs
View license
[TestCase(2, 1.7e-1)]
        [TestCase(6, 1.2e-1)]
        [TestCase(10, 8e-3)]
        [TestCase(50, 8e-6)]
        [TestCase(1000, 5e-11)]
        public void SimpsonRuleSupportsCompositeIntegration(int partitions, double maxRelativeError)
        {
            Assert.AreEqual(
                TargetAreaA,
                SimpsonRule.IntegrateComposite(TargetFunctionA, StartA, StopA, partitions),
                maxRelativeError * TargetAreaA,
                "Composite {0} Partitions",
                partitions);
        }

9. Example

View license
[TestCase(0.1, .57225, 1e-15)]
        [TestCase(0.4, 1.884, 1e-15)]
        [TestCase(1.1, 3.0314166666666666667, 1e-15)]
        [TestCase(3.2, 1.034666666666666667, 1e-15)]
        [TestCase(4.5, 6.28125, 1e-15)]
        [TestCase(10.0, 277.5, 1e-15)]
        [TestCase(-10.0, -1010.8333333333333333, 1e-12)]
        public void FitsAtArbitraryPointsWithMaple(double t, double x, double maxAbsoluteError)
        {
            IInterpolation interpolation = new NevillePolynomialInterpolation(_t, _x);

            Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);
        }

10. Example

View license
[TestCase(2)]
        [TestCase(4)]
        [TestCase(12)]
        public void SupportsLinearCase(int samples)
        {
            double[] x, y, xtest, ytest;
            LinearInterpolationCase.Build(out x, out y, out xtest, out ytest, samples);
            IInterpolation interpolation = new NevillePolynomialInterpolation(x, y);
            for (int i = 0; i < xtest.Length; i++)
            {
                Assert.AreEqual(ytest[i], interpolation.Interpolate(xtest[i]), 1e-12, "Linear with {0} samples, sample {1}", samples, i);
            }
        }

11. Example

Project: mathnet-numerics
Source File: AkimaSplineTest.cs
View license
[TestCase(-2.4, -0.52, 1e-15)]
        [TestCase(-0.9, 1.826, 1e-15)]
        [TestCase(-0.5, 0.25, 1e-15)]
        [TestCase(-0.1, -1.006, 1e-15)]
        [TestCase(0.1, -0.9, 1e-15)]
        [TestCase(0.4, -0.6, 1e-15)]
        [TestCase(1.2, 0.2, 1e-15)]
        [TestCase(10.0, 9, 1e-15)]
        [TestCase(-10.0, -151, 1e-15)]
        public void FitsAtArbitraryPoints(double t, double x, double maxAbsoluteError)
        {
            IInterpolation it = CubicSpline.InterpolateAkima(_t, _y);

            // TODO: Verify the expected values (that they are really the expected ones)
            Assert.AreEqual(x, it.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);
        }

12. Example

Project: mathnet-numerics
Source File: AkimaSplineTest.cs
View license
[TestCase(5)]
        [TestCase(7)]
        [TestCase(15)]
        public void SupportsLinearCase(int samples)
        {
            double[] x, y, xtest, ytest;
            LinearInterpolationCase.Build(out x, out y, out xtest, out ytest, samples);
            IInterpolation it = CubicSpline.InterpolateAkima(x, y);
            for (int i = 0; i < xtest.Length; i++)
            {
                Assert.AreEqual(ytest[i], it.Interpolate(xtest[i]), 1e-15, "Linear with {0} samples, sample {1}", samples, i);
            }
        }

13. Example

View license
[TestCase(0.1, .19389203383553566255, 1e-14)]
        [TestCase(0.4, .88132900698869875369, 1e-14)]
        [TestCase(1.1, 3.5057665681580626913, 1e-15)]
        [TestCase(3.01, 1548.7666642693586902, 1e-10)]
        [TestCase(3.02, 3362.2564334253633516, 1e-10)]
        [TestCase(3.03, -22332.603641443806014, 1e-8)]
        [TestCase(3.1, -440.30323769822443789, 1e-11)]
        [TestCase(3.2, -202.42421196280566349, 1e-12)]
        [TestCase(4.5, 21.208249625210155439, 1e-12)]
        [TestCase(10.0, -4.8936986959784751517, 1e-13)]
        [TestCase(-10.0, -3.6017584308603731307, 1e-13)]
        public void FitsAtArbitraryPointsWithMaple(double t, double x, double maxAbsoluteError)
        {
            IInterpolation interpolation = BulirschStoerRationalInterpolation.Interpolate(_t, _x);

            Assert.AreEqual(x, interpolation.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);
        }

14. Example

Project: mathnet-numerics
Source File: CubicSplineTest.cs
View license
[TestCase(-2.4, .144, 1e-15)]
        [TestCase(-0.9, 1.7906428571428571429, 1e-15)]
        [TestCase(-0.5, .47321428571428571431, 1e-15)]
        [TestCase(-0.1, -.80992857142857142857, 1e-15)]
        [TestCase(0.1, -1.1089285714285714286, 1e-15)]
        [TestCase(0.4, -1.0285714285714285714, 1e-15)]
        [TestCase(1.2, .30285714285714285716, 1e-15)]
        [TestCase(10.0, 189, 1e-15)]
        [TestCase(-10.0, 677, 1e-12)]
        public void NaturalFitsAtArbitraryPoints(double t, double x, double maxAbsoluteError)
        {
            IInterpolation it = CubicSpline.InterpolateNatural(_t, _y);
            Assert.AreEqual(x, it.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);
        }

15. Example

Project: mathnet-numerics
Source File: CubicSplineTest.cs
View license
[TestCase(-2.4, 1.12, 1e-15)]
        [TestCase(-0.9, 1.8243928571428571428, 1e-15)]
        [TestCase(-0.5, .54910714285714285715, 1e-15)]
        [TestCase(-0.1, -.78903571428571428572, 1e-15)]
        [TestCase(0.1, -1.1304642857142857143, 1e-15)]
        [TestCase(0.4, -1.1040000000000000000, 1e-15)]
        [TestCase(1.2, .4148571428571428571, 1e-15)]
        [TestCase(10.0, -608.14285714285714286, 1e-12)]
        [TestCase(-10.0, 1330.1428571428571429, 1e-12)]
        public void FixedFirstDerivativeFitsAtArbitraryPoints(double t, double x, double maxAbsoluteError)
        {
            IInterpolation it = CubicSpline.InterpolateBoundaries(_t, _y, SplineBoundaryCondition.FirstDerivative, 1.0, SplineBoundaryCondition.FirstDerivative, -1.0);
            Assert.AreEqual(x, it.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);
        }

16. Example

Project: mathnet-numerics
Source File: CubicSplineTest.cs
View license
[TestCase(-2.4, -.8999999999999999993, 1e-15)]
        [TestCase(-0.9, 1.7590357142857142857, 1e-15)]
        [TestCase(-0.5, .41517857142857142854, 1e-15)]
        [TestCase(-0.1, -.82010714285714285714, 1e-15)]
        [TestCase(0.1, -1.1026071428571428572, 1e-15)]
        [TestCase(0.4, -1.0211428571428571429, 1e-15)]
        [TestCase(1.2, .31771428571428571421, 1e-15)]
        [TestCase(10.0, 39, 1e-13)]
        [TestCase(-10.0, -37, 1e-12)]
        public void FixedSecondDerivativeFitsAtArbitraryPoints(double t, double x, double maxAbsoluteError)
        {
            IInterpolation it = CubicSpline.InterpolateBoundaries(_t, _y, SplineBoundaryCondition.SecondDerivative, -5.0, SplineBoundaryCondition.SecondDerivative, -1.0);
            Assert.AreEqual(x, it.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);
        }

17. Example

Project: mathnet-numerics
Source File: CubicSplineTest.cs
View license
[TestCase(2)]
        [TestCase(4)]
        [TestCase(12)]
        public void NaturalSupportsLinearCase(int samples)
        {
            double[] x, y, xtest, ytest;
            LinearInterpolationCase.Build(out x, out y, out xtest, out ytest, samples);
            IInterpolation it = CubicSpline.InterpolateNatural(x, y);
            for (int i = 0; i < xtest.Length; i++)
            {
                Assert.AreEqual(ytest[i], it.Interpolate(xtest[i]), 1e-15, "Linear with {0} samples, sample {1}", samples, i);
            }
        }

18. Example

View license
[TestCase(0.1, .487425, 1e-15)]
        [TestCase(0.4, 1.6968, 1e-15)]
        [TestCase(1.1, 3.081925, 1e-15)]
        [TestCase(3.2, .9408, 1e-15)]
        [TestCase(4.5, 7.265625, 1e-14)]
        [TestCase(10.0, 592.5, 1e-10)]
        [TestCase(-10.0, 657.5, 1e-9)]
        public void FitsAtArbitraryPoints(double t, double x, double maxAbsoluteError)
        {
            IInterpolation it = Barycentric.InterpolatePolynomialEquidistant(Tmin, Tmax, _y);
            Assert.AreEqual(x, it.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);
        }

19. Example

View license
[TestCase(2)]
        [TestCase(4)]
        [TestCase(12)]
        public void SupportsLinearCase(int samples)
        {
            double[] x, y, xtest, ytest;
            LinearInterpolationCase.Build(out x, out y, out xtest, out ytest, samples);
            IInterpolation it = Barycentric.InterpolatePolynomialEquidistant(x, y);
            for (int i = 0; i < xtest.Length; i++)
            {
                Assert.AreEqual(ytest[i], it.Interpolate(xtest[i]), 1e-12, "Linear with {0} samples, sample {1}", samples, i);
            }
        }

20. Example

View license
[TestCase(-2.4, -4.5968, 1e-14)]
        [TestCase(-0.9, 1.65395, 1e-15)]
        [TestCase(-0.5, 0.21875, 1e-15)]
        [TestCase(-0.1, -0.84205, 1e-15)]
        [TestCase(0.1, -1.10805, 1e-15)]
        [TestCase(0.4, -1.1248, 1e-15)]
        [TestCase(1.2, 0.5392, 1e-15)]
        [TestCase(10.0, -4431.0, 1e-8)]
        [TestCase(-10.0, -5071.0, 1e-8)]
        public void PolynomialFitsAtArbitraryPointsWithMaple(double t, double x, double maxAbsoluteError)
        {
            IInterpolation it = Barycentric.InterpolateRationalFloaterHormann(_t, _y);
            Assert.AreEqual(x, it.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);
        }

21. Example

View license
[TestCase(2)]
        [TestCase(4)]
        [TestCase(12)]
        public void SupportsLinearCase(int samples)
        {
            double[] x, y, xtest, ytest;
            LinearInterpolationCase.Build(out x, out y, out xtest, out ytest, samples);
            IInterpolation it = Barycentric.InterpolateRationalFloaterHormann(x, y);
            for (int i = 0; i < xtest.Length; i++)
            {
                Assert.AreEqual(ytest[i], it.Interpolate(xtest[i]), 1e-14, "Linear with {0} samples, sample {1}", samples, i);
            }
        }

22. Example

View license
[TestCase(-2.4, .6, 1e-15)]
        [TestCase(-0.9, 1.7, 1e-15)]
        [TestCase(-0.5, .5, 1e-15)]
        [TestCase(-0.1, -.7, 1e-15)]
        [TestCase(0.1, -.9, 1e-15)]
        [TestCase(0.4, -.6, 1e-15)]
        [TestCase(1.2, .2, 1e-15)]
        [TestCase(10.0, 9.0, 1e-15)]
        [TestCase(-10.0, -7.0, 1e-15)]
        public void FitsAtArbitraryPoints(double t, double x, double maxAbsoluteError)
        {
            IInterpolation ip = LinearSpline.Interpolate(_t, _y);
            Assert.AreEqual(x, ip.Interpolate(t), maxAbsoluteError, "Interpolation at {0}", t);
        }

23. Example

View license
[TestCase(2)]
        [TestCase(4)]
        [TestCase(12)]
        public void SupportsLinearCase(int samples)
        {
            double[] x, y, xtest, ytest;
            LinearInterpolationCase.Build(out x, out y, out xtest, out ytest, samples);

            IInterpolation ip = LinearSpline.Interpolate(x, y);
            for (int i = 0; i < xtest.Length; i++)
            {
                Assert.AreEqual(ytest[i], ip.Interpolate(xtest[i]), 1e-15, "Linear with {0} samples, sample {1}", samples, i);
            }
        }