예제 #1
0
        public void Test003_GivenSpeedControl_WhenMoreThanTwoDistanceSamplesExist_ThenReturnTheCorrectSpeed()
        {
            double[] distanceSamples = new double[] { 0.0, 0.19, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25 };
            int      seconds         = 15;

            int expectedResult = 74;
            int actualResult   = SpeedControl.GetMaxAverageSpeedPerHour(seconds, distanceSamples);

            Assert.AreEqual(expectedResult, actualResult);
        }
예제 #2
0
        public void Test001_GivenSpeedControl_WhenLessThanTwoDistanceSamplesExist_ThenZeroIsReturned()
        {
            double[] distanceSamples = new double[] { 0.0 };
            int      seconds         = 25;

            int expectedResult = 0;
            int actualResult   = SpeedControl.GetMaxAverageSpeedPerHour(seconds, distanceSamples);

            Assert.AreEqual(expectedResult, actualResult);
        }