public void ClearTest() { double[] values = { 0.5, -1.2, 0.7, 0.2, 1.1 }; var target = new RunningCircularStatistics(); for (int i = 0; i < values.Length; i++) { target.Push(values[i]); } target.Clear(); double[] values2 = { 1.5, -5.2, 0.7, 1.2, 9.1 }; for (int i = 0; i < values.Length; i++) { target.Push(values2[i]); } Assert.AreEqual(Circular.Mean(values2), target.Mean, 1e-10); Assert.AreEqual(Circular.Variance(values2), target.Variance, 1e-10); Assert.AreEqual(Circular.StandardDeviation(values2), target.StandardDeviation, 1e-10); Assert.AreEqual(values2.Length, target.Count); }
public void VarianceTest() { double[] values = { 0.5, -1.2, 0.7, 0.2, 1.1 }; var target = new RunningCircularStatistics(); for (int i = 0; i < values.Length; i++) { target.Push(values[i]); } double expected = Circular.Variance(values); double actual = target.Variance; Assert.AreEqual(expected, actual); }