Exemplo n.º 1
0
        public void BoundedExclusiveIntervalEndpoint()
        {
            var boundedExclusive = new IntervalEndpoint <int>(7, false);

            Assert.IsTrue(boundedExclusive.Bounded);
            Assert.IsFalse(boundedExclusive.Inclusive);
            Assert.AreEqual(7, boundedExclusive.Point);
        }
Exemplo n.º 2
0
        public void UnboundedIntervalEndpointNonsensePoint()
        {
            var unbounded = new IntervalEndpoint <int>(int.MaxValue);

            Assert.IsFalse(unbounded.Bounded);
            Assert.IsFalse(unbounded.Inclusive); // implied by being unbounded
            Assert.AreEqual(int.MaxValue, unbounded.Point);
        }
Exemplo n.º 3
0
        public void BoundedInclusiveIntervalEndpoint()
        {
            var boundedInclusive = new IntervalEndpoint <int>(42, true);

            Assert.IsTrue(boundedInclusive.Bounded);
            Assert.IsTrue(boundedInclusive.Inclusive);
            Assert.AreEqual(42, boundedInclusive.Point);
        }
Exemplo n.º 4
0
        public Interval(double minimum, double maximum, IntervalEndpoint minimumEndpoint, IntervalEndpoint maximumEndpoint)
        {
            if (maximum < minimum)
            {
                throw new ArgumentException("maximum < minimum");
            }

            _minimum         = minimum;
            _maximum         = maximum;
            _minimumEndpoint = minimumEndpoint;
            _maximumEndpoint = maximumEndpoint;
        }