public void Add(double[] value, double threshold, double influence, int lag, int expectedRisingFlank, int expectedFallingFlank)
        {
            var zScore = new SmoothedZScore();

            zScore.SetThreshold(threshold);
            zScore.SetInfluence(influence);
            zScore.SetLag(lag);

            int resultRisingFlank  = 0;
            int resultFallingFlank = 0;

            for (int i = 0; i < value.Length; i++)
            {
                var detectedValue = zScore.Add(value[i]);

                if (detectedValue == 1)
                {
                    resultRisingFlank++;
                }
                else if (detectedValue == -1)
                {
                    resultFallingFlank++;
                }
            }

            Assert.True(expectedRisingFlank == resultRisingFlank &&
                        expectedFallingFlank == resultFallingFlank);
        }
        public void SetInfluence_Exception_Top()
        {
            var zScore = new SmoothedZScore();

            Assert.Throws <ArgumentException>(() => zScore.SetInfluence(2));
        }
        public void SetLag_Exception()
        {
            var zScore = new SmoothedZScore();

            Assert.Throws <ArgumentException>(() => zScore.SetLag(0));
        }
        public void SetThreshold_Exception()
        {
            var zScore = new SmoothedZScore();

            Assert.Throws <ArgumentException>(() => zScore.SetThreshold(-1));
        }