Example #1
0
        public void Stats_2()
        {
            var s = new SampleStatistics();

            s.Put(-1);
            s.Put(1);
            Assert.That(s.Mean.Equals(0));
            Assert.That(s.Variance.Equals(2));
            Assert.That(s.Deviation.Equals(Math.Sqrt(2)));
        }
Example #2
0
        public void Stats_3()
        {
            var s = new SampleStatistics();

            s.Put(89);
            s.Put(90);
            s.Put(91);
            Assert.That(s.Mean.Equals(90));
            Assert.That(s.Variance.Equals(1));
            Assert.That(s.Deviation.Equals(1));
        }
Example #3
0
        public void Stats_1()
        {
            var s = new SampleStatistics();

            s.Put(-1);
            Assert.That(s.Mean.Equals(-1));
            Assert.That(double.IsNaN(s.Variance));
            Assert.That(double.IsNaN(s.Deviation));
        }
Example #4
0
        public void Stats_9()
        {
            var s = new SampleStatistics();

            s.Put(2);
            s.Put(4);
            s.Put(4);
            s.Put(4);
            s.Put(5);
            s.Put(5);
            s.Put(5);
            s.Put(7);
            s.Put(9);
            Assert.That(s.Mean.Equals(5));
            Assert.That(s.Variance.Equals(4));
            Assert.That(s.Deviation.Equals(2));
        }