public void GivenThrowException_WhenOutsideConstraints_Throws()
            {
                var value = new NumericComparableClass(1);

                Assert.Throws <ConstraintException>(() => value.ConstrainToRange(min, max, true));
                value = new NumericComparableClass(10);
                Assert.Throws <ConstraintException>(() => value.ConstrainToRange(min, max, true));
                value = null;
                Assert.Throws <ConstraintException>(() => value.ConstrainToRange(min, max, true));
            }
            public void WhenMoreThanMax_ReturnsMax()
            {
                var value  = new NumericComparableClass(10);
                var result = value.ConstrainToRange(min, max);

                Expect(result, EqualTo(max));
            }
            public void WhenLessThanMin_ReturnsMin()
            {
                var value  = new NumericComparableClass(1);
                var result = value.ConstrainToRange(min, max);

                Expect(result, EqualTo(min));
            }
            public void WhenValueNull_ReturnsMin()
            {
                NumericComparableClass value = null;
                var result = value.ConstrainToRange(min, max);

                Expect(result, EqualTo(min));
            }
            public void WhenBetweenMinMax_ReturnsValue()
            {
                var value  = new NumericComparableClass(5);
                var result = value.ConstrainToRange(min, max);

                Expect(result, EqualTo(new NumericComparableClass(5)));
            }
            public void WhenMaxNull_Throws()
            {
                var value = new NumericComparableClass(5);

                Assert.Throws <ArgumentNullException>(() => value.ConstrainToRange(min, null));
            }