public Range Intersect(Range range) { int start = Math.Max(Start, range.Start); int end = Math.Min(End, range.End); if (IsRangeInValid(start, end)) throw new ArgumentException(); return new Range(start, end); }
private void AssertNumberInRange(Range range, int number, bool expectedResult) { var result = range.Include(number); Assert.AreEqual(expectedResult, result); }