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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }