public void IsFloat_Bad_Word() { var target = new IsTypeClass { NumAsString = "1234.567", OtherField = "Hello, World" }; Rule rule = Rule.IsFloat("OtherField"); Mre engine = new Mre(); var compiledRule = engine.CompileRule <IsTypeClass>(rule); bool passes = compiledRule(target); Assert.IsFalse(passes); }
public void IsDouble_OK_Int() { var target = new IsTypeClass { NumAsString = "1234", OtherField = "Hello, World" }; Rule rule = Rule.IsDouble("NumAsString"); Mre engine = new Mre(); var compiledRule = engine.CompileRule <IsTypeClass>(rule); bool passes = compiledRule(target); Assert.IsTrue(passes); }
public void IsFloat_OK_Float() { var target = new IsTypeClass { NumAsString = "1234.567", OtherField = "Hello, World" }; Rule rule = Rule.IsFloat("NumAsString"); MRE engine = new MRE(); var compiledRule = engine.CompileRule <IsTypeClass>(rule); bool passes = compiledRule(target); Assert.IsTrue(passes); }