예제 #1
0
        public void TestMergeTwoNotMerged()
        {
            var i = Intervals.MergeTwo(new Interval(1, 1), new Interval(2, 2));

            Assert.IsNull(i);

            i = Intervals.MergeTwo(new Interval(5, 2), new Interval(7, 6));
            Assert.IsNull(i);
        }
예제 #2
0
        public void TestMergeTwoMerged()
        {
            var i = Intervals.MergeTwo(new Interval(1, 1), new Interval(1, 1));

            Assert.IsNotNull(i);
            Assert.AreEqual(1, i.a);
            Assert.AreEqual(1, i.b);

            i = Intervals.MergeTwo(new Interval(1, 2), new Interval(1, 3));
            Assert.IsNotNull(i);
            Assert.AreEqual(1, i.a);
            Assert.AreEqual(3, i.b);

            i = Intervals.MergeTwo(new Interval(1, 3), new Interval(2, 5));
            Assert.IsNotNull(i);
            Assert.AreEqual(1, i.a);
            Assert.AreEqual(5, i.b);

            i = Intervals.MergeTwo(new Interval(2, 5), new Interval(1, 3));
            Assert.IsNotNull(i);
            Assert.AreEqual(1, i.a);
            Assert.AreEqual(5, i.b);
        }