public void testFull()
        {
            IRunningAverage runningAverage = new FullRunningAverage();

            Assert.AreEqual(0, runningAverage.GetCount());
            Assert.True(Double.IsNaN(runningAverage.GetAverage()));
            runningAverage.AddDatum(1.0);
            Assert.AreEqual(1, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.AddDatum(1.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.AddDatum(4.0);
            Assert.AreEqual(3, runningAverage.GetCount());
            Assert.AreEqual(2.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.AddDatum(-4.0);
            Assert.AreEqual(4, runningAverage.GetCount());
            Assert.AreEqual(0.5, runningAverage.GetAverage(), EPSILON);

            runningAverage.RemoveDatum(-4.0);
            Assert.AreEqual(3, runningAverage.GetCount());
            Assert.AreEqual(2.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.RemoveDatum(4.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);

            runningAverage.ChangeDatum(0.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.ChangeDatum(2.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(2.0, runningAverage.GetAverage(), EPSILON);
        }
        public void testFull()
        {
            IRunningAverage runningAverage = new FullRunningAverage();

            Assert.AreEqual(0, runningAverage.GetCount());
            Assert.True(Double.IsNaN(runningAverage.GetAverage()));
            runningAverage.AddDatum(1.0);
            Assert.AreEqual(1, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.AddDatum(1.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.AddDatum(4.0);
            Assert.AreEqual(3, runningAverage.GetCount());
            Assert.AreEqual(2.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.AddDatum(-4.0);
            Assert.AreEqual(4, runningAverage.GetCount());
            Assert.AreEqual(0.5, runningAverage.GetAverage(), EPSILON);

            runningAverage.RemoveDatum(-4.0);
            Assert.AreEqual(3, runningAverage.GetCount());
            Assert.AreEqual(2.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.RemoveDatum(4.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);

            runningAverage.ChangeDatum(0.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);
            runningAverage.ChangeDatum(2.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(2.0, runningAverage.GetAverage(), EPSILON);
        }
        public void testCopyConstructor()
        {
            IRunningAverage runningAverage = new FullRunningAverage();

            runningAverage.AddDatum(1.0);
            runningAverage.AddDatum(1.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);

            IRunningAverage copy = new FullRunningAverage(runningAverage.GetCount(), runningAverage.GetAverage());
            Assert.AreEqual(2, copy.GetCount());
            Assert.AreEqual(1.0, copy.GetAverage(), EPSILON);
        }
        public void testCopyConstructor()
        {
            IRunningAverage runningAverage = new FullRunningAverage();

            runningAverage.AddDatum(1.0);
            runningAverage.AddDatum(1.0);
            Assert.AreEqual(2, runningAverage.GetCount());
            Assert.AreEqual(1.0, runningAverage.GetAverage(), EPSILON);

            IRunningAverage copy = new FullRunningAverage(runningAverage.GetCount(), runningAverage.GetAverage());

            Assert.AreEqual(2, copy.GetCount());
            Assert.AreEqual(1.0, copy.GetAverage(), EPSILON);
        }