Ejemplo n.º 1
0
        public void calculate_average_position()
        {
            var list = new int[4];

            JitterDetection.CalculateAveragePosition(list, list.Length, 6);
            JitterDetection.CalculateAveragePosition(list, list.Length, 7);
            JitterDetection.CalculateAveragePosition(list, list.Length, 8);
            var avg = JitterDetection.CalculateAveragePosition(list, list.Length, 9);

            Assert.Equal(7, avg);
        }
Ejemplo n.º 2
0
        public void push_latest_value_roll_off()
        {
            var list = new int[4];

            JitterDetection.CalculateAveragePosition(list, list.Length, 5);
            JitterDetection.CalculateAveragePosition(list, list.Length, 6);
            JitterDetection.CalculateAveragePosition(list, list.Length, 7);
            JitterDetection.CalculateAveragePosition(list, list.Length, 8);

            Assert.Equal(8, list[0]);
            Assert.Equal(7, list[1]);
            Assert.Equal(6, list[2]);
            Assert.Equal(5, list[3]);

            JitterDetection.CalculateAveragePosition(list, list.Length, 9);
            Assert.Equal(9, list[0]);
            Assert.Equal(8, list[1]);
            Assert.Equal(7, list[2]);
            Assert.Equal(6, list[3]);
        }