Example #1
0
        public void IsOverlapping_SameInterval_ReturnsTrue()
        {
            var interval = 10.IntervalTo(20);

            var output = IntervalExtensions.IsOverlapping(interval, interval);

            Assert.That(output, Is.True);
        }
Example #2
0
        public void IsOverlapping_WithTestCases_ProducesCorrectResults(int start1, int end1, int start2, int end2, bool expected)
        {
            Interval <int> interval = Interval.Create(start1, end1);
            Interval <int> other    = Interval.Create(start2, end2);

            var output = IntervalExtensions.IsOverlapping(interval, other);

            Assert.That(output, Is.EqualTo(expected));
        }
Example #3
0
        public void IsOverlapping_NullIntervalAndOther_ReturnsFalse()
        {
            Interval <int> interval = null;
            Interval <int> other    = null;

            var output = IntervalExtensions.IsOverlapping(interval, other);

            Assert.That(output, Is.False);
        }