GenerateValidValueLessThan() public method

public GenerateValidValueLessThan ( object maxValue ) : object
maxValue object
return object
 public void Test_GenerateValueLessThan_WhenDecimalAndRule_WhenRuleMoreRestrictive_ShouldRetValidValue()
 {
     IPropDef def = new PropDefFake {
         PropertyType = typeof(decimal)
     };
     def.AddPropRule(CreatePropRuleDecimal(3M, 7M));
     ValidValueGeneratorDecimal generator = new ValidValueGeneratorDecimal(def);
     Assert.AreSame(typeof(decimal), def.PropertyType);
     Assert.IsNotEmpty(def.PropRules.OfType<PropRuleDecimal>().ToList());
     PropRuleDecimal propRule = def.PropRules.OfType<PropRuleDecimal>().First();
     Assert.AreEqual(3M, propRule.MinValue);
     Assert.AreEqual(7M, propRule.MaxValue);
     decimal value = (decimal) generator.GenerateValidValueLessThan(decimal.MaxValue - 5);
     Assert.IsNotNull(value);
     Assert.GreaterOrEqual(value, 3M);
     Assert.LessOrEqual(value, decimal.MaxValue - 5);
     Assert.LessOrEqual(value, 7M);
 }
 public void Test_GenerateValueLessThan_WhenDecimalAndNoRule_ShouldRetValidValue()
 {
     IPropDef def = new PropDefFake {
         PropertyType = typeof(decimal)
     };
     ValidValueGeneratorDecimal generator = new ValidValueGeneratorDecimal(def);
     Assert.AreSame(typeof(decimal), def.PropertyType);
     Assert.IsEmpty(def.PropRules.OfType<PropRuleDecimal>().ToList());
     decimal value = (decimal) generator.GenerateValidValueLessThan(decimal.MinValue + 5);
     Assert.IsNotNull(value);
     Assert.GreaterOrEqual(value, decimal.MinValue );
     Assert.LessOrEqual(value, decimal.MinValue + 5);
 }