Exemplo n.º 1
0
        public void JsonMustNotMatch()
        {
            var message  = JsonMessage.FromString(json);
            var patterns = new JsonMessagePattern(new string[]
            {
                "$..Products[?(@.Price >= 100)].Name"
            });

            Assert.IsFalse(patterns.Match(message));
        }
Exemplo n.º 2
0
        public void JsonMustMatch()
        {
            var message  = JsonMessage.FromString(json);
            var patterns = new JsonMessagePattern(new string[]
            {
                "$.Manufacturers[?(@.Name == 'Acme Co')]",
                "$.Manufacturers[?(@.Name == 'Contoso')]"
            });

            Assert.IsTrue(patterns.Match(message));
        }