Esempio n. 1
0
        public void JSONNestedPropertiesFalse()
        {
            string  json = ReadfromResource("json2.json");
            dynamic data = Json.Decode(json);
            Rule    rule = Rule.Create("config.rxstatus", mreOperator.Equal, "Pending") &
                           Rule.Create("config.rxstatus", mreOperator.Equal, "Pending");
            MRE  engine       = new MRE();
            var  compiledRule = engine.CompileJSONRule <dynamic>(rule);
            bool passes       = compiledRule(data, "");

            Assert.IsTrue(passes);
        }
Esempio n. 2
0
        public void JSONNestedProofing()
        {
            string  json = ReadfromResource("json2.json");
            dynamic data = Json.Decode(json);
            Rule    rule = Rule.Create("Job.ChildJob.name", mreOperator.Equal, "childjob1") &
                           Rule.Create("Job.name", mreOperator.Equal, "Job1");
            MRE  engine       = new MRE();
            var  compiledRule = engine.CompileJSONRule <dynamic>(rule);
            bool passes       = compiledRule(data, "");

            Assert.IsFalse(passes);
        }
Esempio n. 3
0
        public void JSONPropertiesTrue()
        {
            //Order order = ExampleUsage.GetOrder();
            string json = "{  \"AnnotationId\": \"f573e938-7602-5f07-7d64-f92c162199ff\",\"RecordId\": \"788\",\"PageNumber\": \"90\",  \"ParentId\": \"fdc732ee-4e8d-c930-2d85-14933013998a\"}";

            dynamic data = Json.Decode(json);
            Rule    rule = Rule.Create("RecordId", mreOperator.Equal, "788") &
                           Rule.Create("PageNumber", mreOperator.Equal, "90");

            MRE  engine       = new MRE();
            var  compiledRule = engine.CompileJSONRule <dynamic>(rule);
            bool passes       = compiledRule(data, "");

            Assert.IsTrue(passes);
        }