Exemplo n.º 1
0
        public void RangeReversal()
        {
            var subject  = new QRange(6, -2, 2);
            var expected = new QRange(2, 2, 6);

            Assert.Equal(expected, subject.Reverse());

            subject  = new QRange(1, 1, 0);
            expected = new QRange(0, -1, 1);
            Assert.Equal(expected, subject.Reverse());

            subject  = new QRange(1, 2, 2);
            expected = new QRange(1, -2, 1);
            Assert.Equal(expected, subject.Reverse());
        }
Exemplo n.º 2
0
        public void EmptyRangeSamples()
        {
            var subject = new QRange(2, 2, 1);

            Assert.Empty(subject);
            Assert.Empty(subject.Reverse());

            subject = new QRange(2, 1);
            Assert.Empty(subject);
            Assert.Empty(subject.Reverse());

            subject = new QRange(1, -1, 2);
            Assert.Empty(subject);
            Assert.Empty(subject.Reverse());

            subject = new QRange(1, 2, 0);
            Assert.Empty(subject);
            Assert.Empty(subject.Reverse());
        }