Inheritance: ValidValueGenerator, IValidValueGeneratorNumeric
 public void Test_GenerateValue_WhenDouble_ShouldSet()
 {
     Type propertyType = typeof(double);
     IPropDef def = new PropDefFake {
         PropertyType = propertyType
     };
     ValidValueGenerator valueGenerator = new ValidValueGeneratorDouble(def);
     object value = valueGenerator.GenerateValidValue();
     Assert.IsNotNull(value);
     Assert.IsInstanceOf(typeof(double), value);
     Assert.AreNotEqual(valueGenerator.GenerateValidValue(), value);
 }
 public void Test_GenerateValueGreaterThan_WhenDoubleAndNoRule_ShouldRetValidValue()
 {
     IPropDef def = new PropDefFake {
         PropertyType = typeof(double)
     };
     var generator = new ValidValueGeneratorDouble(def);
     Assert.AreSame(typeof(double), def.PropertyType);
     Assert.IsEmpty(def.PropRules.OfType<PropRuleDouble>().ToList<PropRuleDouble>());
     var value = (double) generator.GenerateValidValueGreaterThan(1.7976931348623157E+308);
     Assert.IsNotNull(value);
     Assert.GreaterOrEqual(value, double.MaxValue);
 }
 public void Test_GenerateValue_WhenDecimapAndRule_ShouldRetValidValue()
 {
     IPropDef def = new PropDefFake {
         PropertyType = typeof(double)
     };
     def.AddPropRule(CreatePropRuleDouble(3.01, 7.0004));
     ValidValueGenerator generator = new ValidValueGeneratorDouble(def);
     Assert.AreSame(typeof(double), def.PropertyType);
     Assert.IsNotEmpty(def.PropRules.OfType<PropRuleDouble>().ToList<PropRuleDouble>());
     var propRule = def.PropRules.OfType<PropRuleDouble>().First<PropRuleDouble>();
     Assert.AreEqual(3.01, propRule.MinValue);
     Assert.AreEqual(7.0004, propRule.MaxValue);
     var value = (double) generator.GenerateValidValue();
     Assert.IsNotNull(value);
     Assert.GreaterOrEqual(value, 3.01);
     Assert.LessOrEqual(value, 7.0004);
 }
 public void Test_GenerateValueGreaterThan_WhenDoubleAndRule_LtNull_ShouldRetValidValueUsingRules()
 {
     IPropDef def = new PropDefFake {
         PropertyType = typeof(double)
     };
     def.AddPropRule(CreatePropRuleDouble(3.0, double.MaxValue));
     var generator = new ValidValueGeneratorDouble(def);
     Assert.AreSame(typeof(double), def.PropertyType);
     Assert.IsNotEmpty(def.PropRules.OfType<PropRuleDouble>().ToList<PropRuleDouble>());
     var propRule = def.PropRules.OfType<PropRuleDouble>().First<PropRuleDouble>();
     Assert.AreEqual(3.0, propRule.MinValue);
     Assert.AreEqual(1.7976931348623157E+308, propRule.MaxValue);
     var value = (double) generator.GenerateValidValueGreaterThan(null);
     Assert.IsNotNull(value);
     Assert.GreaterOrEqual(value, 3.0);
     Assert.LessOrEqual(value, double.MaxValue);
 }