コード例 #1
0
        public void Contains_WithStartAdjacentZeroIntervalIncluded_ReturnsTrue(bool aEndInclusive, bool bStartInclusive, bool bEndInclusively)
        {
            var intervalA = new IntegerInterval(0, true, 3, aEndInclusive);
            var intervalB = new IntegerInterval(0, bStartInclusive, 0, bEndInclusively);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.True);
        }
コード例 #2
0
        public void Contains_InDegenerateInterval_ReturnsTrue(bool bStartInclusive, bool bEndInclusively)
        {
            var intervalA = new IntegerInterval(0, true, 0, true);
            var intervalB = new IntegerInterval(0, bStartInclusive, 0, bEndInclusively);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.True);
        }
コード例 #3
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_InDegenerateInterval_ReturnsTrue(bool bStartInclusive, bool bEndInclusively)
        {
            var intervalA = new IntegerInterval(0, true, 0, true);
            var intervalB = new IntegerInterval(0, bStartInclusive, 0, bEndInclusively);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.True);
        }
コード例 #4
0
        public void Contains_WithIntervalAdjacentlyExcludedAtStart_ReturnsFalse(bool aEndInclusive, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(0, false, 3, aEndInclusive);
            var intervalB = new IntegerInterval(0, true, 2, bEndInclusive);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.False);
        }
コード例 #5
0
        public void Contains_WithIntervalAdjacentlyExcludedAtEnd_ReturnsTrue(bool aStartInclusive, bool bStartInclusive)
        {
            var intervalA = new IntegerInterval(0, aStartInclusive, 3, false);
            var intervalB = new IntegerInterval(1, bStartInclusive, 3, true);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.False);
        }
コード例 #6
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithEmptyInterval_ReturnsTrue(int aStart, bool aStartInclusive, int aEnd, bool aEndInclusive, bool bStartInclusive, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(aStart, aStartInclusive, aStart, aEndInclusive);
            var intervalB = new IntegerInterval(1, bStartInclusive, 0, bEndInclusive);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.True);
        }
コード例 #7
0
        public void Contains_WithFullyContainedInterval_ReturnsTrue(bool aStartInclusive, bool aEndInclusive, bool bStartInclusive, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(0, aStartInclusive, 3, aEndInclusive);
            var intervalB = new IntegerInterval(1, bStartInclusive, 2, bEndInclusive);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.True);
        }
コード例 #8
0
        public void Contains_WithEmptyInterval_ReturnsTrue(int aStart, bool aStartInclusive, int aEnd, bool aEndInclusive, bool bStartInclusive, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(aStart, aStartInclusive, aStart, aEndInclusive);
            var intervalB = new IntegerInterval(1, bStartInclusive, 0, bEndInclusive);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.True);
        }
コード例 #9
0
        public void Contains_WithNonIntersectingInterval_ReturnsFalse(bool aStartInclusive, bool aEndInclusive, bool bStartInclusive, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(0, aStartInclusive, 1, aEndInclusive);
            var intervalB = new IntegerInterval(2, bStartInclusive, 3, bEndInclusive);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.False);
        }
コード例 #10
0
        public void Contains_WithZeroLengthAndExclusiveStartOrEnd_ReturnsFalse(int startAndEnd, bool startInclusive, bool endInclusive, int value)
        {
            Assume.That(!startInclusive || !endInclusive);

            var interval = new IntegerInterval(startAndEnd, startInclusive, startAndEnd, endInclusive);

            var result = interval.Contains(value);

            Assert.That(result, Is.False);
        }
コード例 #11
0
        public void Contains_WithIncludedValue_ReturnsTrue(int start, int end, int value, bool startInclusive, bool endInclusive)
        {
            Assume.That(start < value && value < end);

            var interval = new IntegerInterval(start, startInclusive, end, endInclusive);

            var result = interval.Contains(value);

            Assert.That(result, Is.True);
        }
コード例 #12
0
        public void Contains_WithInclusiveEnd_ReturnsTrue(int start, int end, bool startInclusive)
        {
            Assume.That(start < end);

            var interval = new IntegerInterval(start, startInclusive, end, true);

            var result = interval.Contains(end);

            Assert.That(result, Is.True);
        }
コード例 #13
0
        public void Contains_WithExclusiveStart_ReturnsFalse(int start, int end, bool endInclusive)
        {
            Assume.That(start <= end);

            var interval = new IntegerInterval(start, false, end, endInclusive);

            var result = interval.Contains(start);

            Assert.That(result, Is.False);
        }
コード例 #14
0
        public void Contains_WithEmptyInterval_ReturnsFalse(int start, int end, bool startInclusive, bool endInclusive, int value)
        {
            Assume.That(start > end);

            var interval = new IntegerInterval(start, startInclusive, end, endInclusive);

            var result = interval.Contains(value);

            Assert.That(result, Is.False);
        }
コード例 #15
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithEmptyInterval_ReturnsFalse(int start, int end, bool startInclusive, bool endInclusive, int value)
        {
            Assume.That(start > end);

            var interval = new IntegerInterval(start, startInclusive, end, endInclusive);

            var result = interval.Contains(value);

            Assert.That(result, Is.False);
        }
コード例 #16
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithEndAdjacentZeroIntervalExcluded_ReturnsFalse(bool aStartInclusive, bool bStartInclusive, bool bEndInclusively)
        {
            var intervalA = new IntegerInterval(0, aStartInclusive, 3, false);
            var intervalB = new IntegerInterval(3, bStartInclusive, 3, bEndInclusively);

            Assume.That(!intervalB.IsEmpty());

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.False);
        }
コード例 #17
0
        public void Contains_FromEmptyInterval_ReturnsFalse(bool aStartInclusive, bool aEndInclusive, int bStart, bool bStartInclusive, int bEnd, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(1, aStartInclusive, 0, aEndInclusive);
            var intervalB = new IntegerInterval(bStart, bStartInclusive, bEnd, bEndInclusive);

            Assume.That(!intervalB.IsEmpty());

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.False);
        }
コード例 #18
0
        public void Contains_WithStartAdjacentZeroIntervalExcluded_ReturnsFalse(bool aEndInclusive, bool bStartInclusive, bool bEndInclusively)
        {
            var intervalA = new IntegerInterval(0, false, 3, aEndInclusive);
            var intervalB = new IntegerInterval(0, bStartInclusive, 0, bEndInclusively);

            Assume.That(!intervalB.IsEmpty());

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.False);
        }
コード例 #19
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_FromEmptyInterval_ReturnsFalse(bool aStartInclusive, bool aEndInclusive, int bStart, bool bStartInclusive, int bEnd, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(1, aStartInclusive, 0, aEndInclusive);
            var intervalB = new IntegerInterval(bStart, bStartInclusive, bEnd, bEndInclusive);

            Assume.That(!intervalB.IsEmpty());

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.False);
        }
コード例 #20
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithZeroLengthAndExclusiveStartOrEnd_ReturnsFalse(int startAndEnd, bool startInclusive, bool endInclusive, int value)
        {
            Assume.That(!startInclusive || !endInclusive);

            var interval = new IntegerInterval(startAndEnd, startInclusive, startAndEnd, endInclusive);

            var result = interval.Contains(value);

            Assert.That(result, Is.False);
        }
コード例 #21
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithNonIntersectingInterval_ReturnsFalse(bool aStartInclusive, bool aEndInclusive, bool bStartInclusive, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(0, aStartInclusive, 1, aEndInclusive);
            var intervalB = new IntegerInterval(2, bStartInclusive, 3, bEndInclusive);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.False);
        }
コード例 #22
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithIntervalAdjacentlyIncludedAtStart_ReturnsTrue(bool aEndInclusive, bool bStartInclusive, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(0, true, 3, aEndInclusive);
            var intervalB = new IntegerInterval(0, bStartInclusive, 2, bEndInclusive);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.True);
        }
コード例 #23
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithIntervalAdjacentlyExcludedAtEnd_ReturnsTrue(bool aStartInclusive, bool bStartInclusive)
        {
            var intervalA = new IntegerInterval(0, aStartInclusive, 3, false);
            var intervalB = new IntegerInterval(1, bStartInclusive, 3, true);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.False);
        }
コード例 #24
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithInclusiveStart_ReturnsTrue(int start, int end, bool endInclusive)
        {
            Assume.That(start < end);

            var interval = new IntegerInterval(start, true, end, endInclusive);

            var result = interval.Contains(start);

            Assert.That(result, Is.True);
        }
コード例 #25
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithIncludedValue_ReturnsTrue(int start, int end, int value, bool startInclusive, bool endInclusive)
        {
            Assume.That(start < value && value < end);

            var interval = new IntegerInterval(start, startInclusive, end, endInclusive);

            var result = interval.Contains(value);

            Assert.That(result, Is.True);
        }
コード例 #26
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithEndAdjacentZeroIntervalIncluded_ReturnsTrue(bool aStartInclusive, bool bStartInclusive, bool bEndInclusively)
        {
            var intervalA = new IntegerInterval(0, aStartInclusive, 3, true);
            var intervalB = new IntegerInterval(3, bStartInclusive, 3, bEndInclusively);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.True);
        }
コード例 #27
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithExclusiveEnd_ReturnsFalse(int start, int end, bool startInclusive)
        {
            Assume.That(start <= end);

            var interval = new IntegerInterval(start, startInclusive, end, false);

            var result = interval.Contains(end);

            Assert.That(result, Is.False);
        }
コード例 #28
0
ファイル: IntervalTests.cs プロジェクト: otac0n/intervals
        public void Contains_WithFullyContainedInterval_ReturnsTrue(bool aStartInclusive, bool aEndInclusive, bool bStartInclusive, bool bEndInclusive)
        {
            var intervalA = new IntegerInterval(0, aStartInclusive, 3, aEndInclusive);
            var intervalB = new IntegerInterval(1, bStartInclusive, 2, bEndInclusive);

            var result = intervalA.Contains(intervalB);

            Assert.That(result, Is.True);
        }