-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/dkackman/LinqStatistics.git
- Loading branch information
Showing
7 changed files
with
363 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Collections.Generic; | ||
using LinqStatistics.NaN; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace LinqStatistics.UnitTests.NaN | ||
{ | ||
[TestClass] | ||
public class KurtosisNaNTests | ||
{ | ||
[TestMethod] | ||
public void KurtosisDoubleNaN() | ||
{ | ||
IEnumerable<double> source = new double[] { }; | ||
|
||
double result = source.KurtosisNaN(); | ||
|
||
Assert.AreEqual(double.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void KurtosisNullableDoubleNaN() | ||
{ | ||
IEnumerable<double?> source = new double?[] { }; | ||
|
||
double? result = source.KurtosisNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
[TestMethod] | ||
public void KurtosisFloatNaN() | ||
{ | ||
IEnumerable<float> source = new float[] { }; | ||
|
||
float result = source.KurtosisNaN(); | ||
|
||
Assert.AreEqual(float.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void KurtosisNullableFloatNaN() | ||
{ | ||
IEnumerable<float?> source = new float?[] { }; | ||
|
||
float? result = source.KurtosisNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Collections.Generic; | ||
using LinqStatistics.NaN; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System; | ||
|
||
namespace LinqStatistics.UnitTests.NaN | ||
{ | ||
[TestClass] | ||
public class LeastSquaresNaNTests | ||
{ | ||
[TestMethod] | ||
public void LeastSquaresDoubleNaN() | ||
{ | ||
var data = new List<Tuple<double, double>>(); | ||
|
||
var result = data.LeastSquaresNaN(); | ||
|
||
Assert.IsNotNull(result); | ||
Assert.IsTrue(double.IsNaN(result.B)); | ||
Assert.IsTrue(double.IsNaN(result.M)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Collections.Generic; | ||
using LinqStatistics.NaN; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace LinqStatistics.UnitTests.NaN | ||
{ | ||
[TestClass] | ||
public class RootMeanSquareNaNTests | ||
{ | ||
[TestMethod] | ||
public void RootMeanSquareDoubleNaN() | ||
{ | ||
IEnumerable<double> source = new double[] { }; | ||
|
||
double result = source.RootMeanSquareNaN(); | ||
|
||
Assert.AreEqual(double.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void RootMeanSquareNullableDoubleNaN() | ||
{ | ||
IEnumerable<double?> source = new double?[] { }; | ||
|
||
double? result = source.RootMeanSquareNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
[TestMethod] | ||
public void RootMeanSquareFloatNaN() | ||
{ | ||
IEnumerable<float> source = new float[] { }; | ||
|
||
float result = source.RootMeanSquareNaN(); | ||
|
||
Assert.AreEqual(float.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void RootMeanSquareNullableFloatNaN() | ||
{ | ||
IEnumerable<float?> source = new float?[] { }; | ||
|
||
float? result = source.RootMeanSquareNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System.Collections.Generic; | ||
using LinqStatistics.NaN; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace LinqStatistics.UnitTests.NaN | ||
{ | ||
[TestClass] | ||
public class SkewnessNaNTests | ||
{ | ||
[TestMethod] | ||
public void SkewnessDoubleNaN() | ||
{ | ||
IEnumerable<double> source = new double[] { }; | ||
|
||
double result = source.SkewnessNaN(); | ||
|
||
Assert.AreEqual(double.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void SkewnessNullableDoubleNaN() | ||
{ | ||
IEnumerable<double?> source = new double?[] { }; | ||
|
||
double? result = source.SkewnessNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
[TestMethod] | ||
public void SkewnessFloatNaN() | ||
{ | ||
IEnumerable<float> source = new float[] { }; | ||
|
||
float result = source.SkewnessNaN(); | ||
|
||
Assert.AreEqual(float.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void SkewnessNullableFloatNaN() | ||
{ | ||
IEnumerable<float?> source = new float?[] { }; | ||
|
||
float? result = source.SkewnessNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
using System.Collections.Generic; | ||
using LinqStatistics.NaN; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace LinqStatistics.UnitTests.NaN | ||
{ | ||
[TestClass] | ||
public class StandardDeviationNaNTests | ||
{ | ||
[TestMethod] | ||
public void StdevDoubleNaN() | ||
{ | ||
IEnumerable<double> source = new double[] { }; | ||
|
||
double result = source.StandardDeviationNaN(); | ||
|
||
Assert.AreEqual(double.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void StdevNullableDoubleNaN() | ||
{ | ||
IEnumerable<double?> source = new double?[] { }; | ||
|
||
double? result = source.StandardDeviationNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
[TestMethod] | ||
public void StdevFloatNaN() | ||
{ | ||
IEnumerable<float> source = new float[] { }; | ||
|
||
float result = source.StandardDeviationNaN(); | ||
|
||
Assert.AreEqual(float.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void StdevNullableFloatNaN() | ||
{ | ||
IEnumerable<float?> source = new float?[] { }; | ||
|
||
float? result = source.StandardDeviationNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
[TestMethod] | ||
public void StdevPDoubleNaN() | ||
{ | ||
IEnumerable<double> source = new double[] { }; | ||
|
||
double result = source.StandardDeviationPNaN(); | ||
|
||
Assert.AreEqual(double.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void StdevPNullableDoubleNaN() | ||
{ | ||
IEnumerable<double?> source = new double?[] { }; | ||
|
||
double? result = source.StandardDeviationPNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
[TestMethod] | ||
public void StdevPFloatNaN() | ||
{ | ||
IEnumerable<float> source = new float[] { }; | ||
|
||
float result = source.StandardDeviationPNaN(); | ||
|
||
Assert.AreEqual(float.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void StdevPNullableFloatNaN() | ||
{ | ||
IEnumerable<float?> source = new float?[] { }; | ||
|
||
float? result = source.StandardDeviationPNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
using System.Collections.Generic; | ||
using LinqStatistics.NaN; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace LinqStatistics.UnitTests.NaN | ||
{ | ||
[TestClass] | ||
public class VarianceNaNTests | ||
{ | ||
[TestMethod] | ||
public void VarDoubleNaN() | ||
{ | ||
IEnumerable<double> source = new double[] { }; | ||
|
||
double result = source.VarianceNaN(); | ||
|
||
Assert.AreEqual(double.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void VarNullableDoubleNaN() | ||
{ | ||
IEnumerable<double?> source = new double?[] { }; | ||
|
||
double? result = source.VarianceNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
[TestMethod] | ||
public void VarFloatNaN() | ||
{ | ||
IEnumerable<float> source = new float[] { }; | ||
|
||
float result = source.VarianceNaN(); | ||
|
||
Assert.AreEqual(float.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void VarNullableFloatNaN() | ||
{ | ||
IEnumerable<float?> source = new float?[] { }; | ||
|
||
float? result = source.VarianceNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
[TestMethod] | ||
public void VarPDoubleNaN() | ||
{ | ||
IEnumerable<double> source = new double[] { }; | ||
|
||
double result = source.VariancePNaN(); | ||
|
||
Assert.AreEqual(double.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void VarPNullableDoubleNaN() | ||
{ | ||
IEnumerable<double?> source = new double?[] { }; | ||
|
||
double? result = source.VariancePNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
|
||
[TestMethod] | ||
public void VarPFloatNaN() | ||
{ | ||
IEnumerable<float> source = new float[] { }; | ||
|
||
float result = source.VariancePNaN(); | ||
|
||
Assert.AreEqual(float.NaN, result); | ||
} | ||
|
||
[TestMethod] | ||
public void VarPNullableFloatNaN() | ||
{ | ||
IEnumerable<float?> source = new float?[] { }; | ||
|
||
float? result = source.VariancePNaN(); | ||
|
||
Assert.IsNull(result); | ||
} | ||
} | ||
} |