コード例 #1
0
        public void TestFromScanTimes()
        {
            var intervals = TimeIntervals.FromScanTimes(new float[] { 1, 2, 3, 4, 8, 9, 11, 15, 16 }, 1);

            Assert.AreEqual(3, intervals.Count);
            Assert.AreEqual(new KeyValuePair <float, float>(1, 4), intervals.Intervals.First());
            Assert.AreEqual(new KeyValuePair <float, float>(8, 9), intervals.Intervals.Skip(1).First());
            Assert.AreEqual(new KeyValuePair <float, float>(15, 16), intervals.Intervals.Last());

            intervals = TimeIntervals.FromScanTimes(new float[] { 2, 4, 6, 8 }, 1);
            Assert.AreEqual(0, intervals.Count);
        }