Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        private void AssertNumberInRange(Range range, int number, bool expectedResult)
        {
            var result = range.Include(number);

            Assert.AreEqual(expectedResult, result);
        }