Beispiel #1
0
        public void testClosestIndex()
        {
            // Testing that the returned index is closest to the requested time
            List <double> test_times = new List <double> {
                1.0, 2.0, 5.0
            };
            TimeGrid tg             = new TimeGrid(test_times);
            int      expected_index = 3;

            QAssert.IsTrue(tg.closestIndex(4) == expected_index,
                           "Expected index: " + expected_index + ", which does not match " +
                           "the returned index: " + tg.closestIndex(4));
        }