Exemplo n.º 1
0
        public void Should_Intersection()
        {
            var d = new IntRange(10, 50);

            d.Intersection(new IntRange(10, 50)).Should().Be(new IntRange(10, 50));
            d.Intersection(new IntRange(20, 40)).Should().Be(new IntRange(20, 40));
            d.Intersection(new IntRange(40, 100)).Should().Be(new IntRange(40, 50));
            d.Intersection(new IntRange(0, 10)).Should().Be(null); // adjacent does not intersect
            d.Intersection(new IntRange(60, 100)).Should().Be(null);
            d.Intersection(new IntRange(0, 20)).Should().Be(new IntRange(10, 20));
        }