예제 #1
0
        public void TestSetMaxLowerThanMin()
        {
            // unittest-intervaldatastructuresetlowmax
            IntervalStruct interval = new IntervalStruct("x", 3, 4, true, true);

            interval.SetMaxBound(-1);
            Assert.AreEqual(-1, interval.GetMinBound());
            Assert.AreEqual(3, interval.GetMaxBound());
        }
예제 #2
0
        public void TestSetMethodsSimple()
        {
            // unittest-intervaldatastructuresetters
            IntervalStruct interval = new IntervalStruct("x", 3, 4, false, true);

            interval.SetMinBound(2);
            interval.SetMaxBound(5);
            interval.SetLeftBoundClosed(true);
            interval.SetRightBoundClosed(false);

            Assert.AreEqual(2, interval.GetMinBound());
            Assert.AreEqual(5, interval.GetMaxBound());
            Assert.AreEqual(true, interval.IsLeftBoundClosed());
            Assert.AreEqual(false, interval.IsRightBoundClosed());
        }