Esempio n. 1
0
        public void MoreThanObjectThrowsError()
        {
            var rule = new MoreThanRule(JsonDocument.Parse("{}").RootElement, 2);

            Assert.Throws <JsonLogicException>(() => rule.Apply());
        }
Esempio n. 2
0
        public void MoreThanNullThrowsError()
        {
            var rule = new MoreThanRule(LiteralRule.Null, 2);

            Assert.Throws <JsonLogicException>(() => rule.Apply());
        }
Esempio n. 3
0
        public void MoreThanArrayThrowsError()
        {
            var rule = new MoreThanRule(new JsonElement[] {}.AsJsonElement(), 2);

            Assert.Throws <JsonLogicException>(() => rule.Apply());
        }
Esempio n. 4
0
        public void MoreThanBooleanThrowsError()
        {
            var rule = new MoreThanRule(false, 2);

            JsonAssert.IsFalse(rule.Apply());
        }
Esempio n. 5
0
        public void MoreThanStringThrowsError()
        {
            var rule = new MoreThanRule("foo", 2);

            Assert.Throws <JsonLogicException>(() => rule.Apply());
        }
Esempio n. 6
0
        public void MoreThanTwoNumbersReturnsFalse()
        {
            var rule = new MoreThanRule(1, 2);

            JsonAssert.IsFalse(rule.Apply());
        }
Esempio n. 7
0
        public void MoreThanTwoNumbersReturnsTrue()
        {
            var rule = new MoreThanRule(2, 1);

            JsonAssert.IsTrue(rule.Apply());
        }