コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }