public void AverageValueIsMovingAverageAfterClosingOfAtLeastTwoIntervals()
        {
            var counter = new ExponentialMovingAverageCounter(.1);

            const int Increment1Count = 3;
            const int Increment2Count = 5;

            for (int i = 0; i < Increment1Count; i++)
            {
                counter.Increment();
            }

            counter.StartNewInterval();

            for (int i = 0; i < Increment2Count; i++)
            {
                counter.Increment();
            }

            counter.StartNewInterval();

            Assert.AreEqual(Increment1Count * .9 + Increment2Count * .1, counter.Average, 10);
        }
        public void AverageValueIsMovingAverageAfterClosingOfAtLeastTwoIntervals()
        {
            var counter = new ExponentialMovingAverageCounter(.1);

            const int Increment1Count = 3;
            const int Increment2Count = 5;

            for (int i = 0; i < Increment1Count; i++)
            {
                counter.Increment();
            }

            counter.StartNewInterval();

            for (int i = 0; i < Increment2Count; i++)
            {
                counter.Increment();
            }

            counter.StartNewInterval();

            Xunit.Assert.Equal(Increment1Count * .9 + Increment2Count * .1, counter.Average, 10);
        }
        public void AverageValueIsFirstIntervalValueAfterClosingOfFirstInterval()
        {
            var counter = new ExponentialMovingAverageCounter(.1);

            const int IncrementCount = 3;

            for (int i = 0; i < IncrementCount; i++)
            {
                counter.Increment();
            }

            counter.StartNewInterval();

            Assert.AreEqual(IncrementCount, counter.Average);
        }
        public void AverageValueIsFirstIntervalValueAfterClosingOfFirstInterval()
        {
            var counter = new ExponentialMovingAverageCounter(.1);

            const int IncrementCount = 3;

            for (int i = 0; i < IncrementCount; i++)
            {
                counter.Increment();
            }

            counter.StartNewInterval();

            Assert.Equal(IncrementCount, counter.Average);
        }