public void testAverage() { IRunningAverage avg = new FullRunningAverage(); IRunningAverage inverted = new InvertedRunningAverage(avg); Assert.AreEqual(0, inverted.GetCount()); avg.AddDatum(1.0); Assert.AreEqual(1, inverted.GetCount()); Assert.AreEqual(-1.0, inverted.GetAverage(), EPSILON); avg.AddDatum(2.0); Assert.AreEqual(2, inverted.GetCount()); Assert.AreEqual(-1.5, inverted.GetAverage(), EPSILON); }
public void testUnsupported2() { IRunningAverage inverted = new InvertedRunningAverage(new FullRunningAverage()); inverted.ChangeDatum(1.0); }
public void testUnsupported3() { IRunningAverage inverted = new InvertedRunningAverage(new FullRunningAverage()); inverted.RemoveDatum(1.0); }