Example #1
0
        public void InRange_OutOfRange_ThrowsArgumentOutOfRangeException()
        {
            var ex = Assert.Throws <ArgumentOutOfRangeException>(
                () => Require.InRange(Range <int> .Empty, 0, C_ParamName)
                );

            Assert.That(ex.ParamName, Is.EqualTo(C_ParamName));
        }
Example #2
0
 public void InRange_InRange_ReturnsValue()
 {
     Assert.That(
         Require.InRange(
             Range.Of(0, true, 5, false),
             1,
             C_ParamName
             ),
         Is.EqualTo(1)
         );
 }
Example #3
0
        public void InRange2_OutOfRange_ThrowsArgumentOutOfRangeException()
        {
            var ex = Assert.Throws <ArgumentOutOfRangeException>(
                () => Require.InRange(
                    Range.Of(0, true, 5, false),
                    Range.Of(3, true, 9, false),
                    C_ParamName
                    )
                );

            Assert.That(ex.ParamName, Is.EqualTo(C_ParamName));
        }
Example #4
0
        public void InRange2_InRange_ReturnsValue()
        {
            var rg = Range.Of(1, true, 3, true);

            Assert.That(
                Require.InRange(
                    Range.Of(0, true, 5, false),
                    rg,
                    C_ParamName
                    ),
                Is.EqualTo(rg)
                );
        }