public void ShouldNotThrowExceptionWhenJsonIsValidWithDepthIsEight()
        {
            var json = JsonUtils.ReadText(JsonUtils.ValidJsonFileName);

            try
            {
                JsonValidator.Validate(json, 8);
                Assert.IsTrue(true);
            }
            catch (JsonNotValidException)
            {
                Assert.IsFalse(false);
            }
        }
        public void ShouldThrowExceptionWhenJsonIsValidButDepthIsOne()
        {
            var json = JsonUtils.ReadText(JsonUtils.ValidJsonFileName);

            JsonValidator.Validate(json, 1);
        }
        public void ShouldThrowArgumentOutOfRangeExceptionWhenDepthIsSmallerThanZero()
        {
            var json = JsonUtils.ReadText(JsonUtils.ValidJsonFileName);

            JsonValidator.Validate(json, -1);
        }
        public void ShouldThrowExceptionWhenJsonIsInvalid()
        {
            var json = JsonUtils.ReadText(JsonUtils.InvalidJsonFileName);

            JsonValidator.Validate(json);
        }
Example #5
0
        public void ShouldReturnTrueWhenJsonIsValidWithDepthIsEight()
        {
            var json = JsonUtils.ReadText(JsonUtils.ValidJsonFileName);

            Assert.IsTrue(JsonValidator.IsValid(json, 8));
        }
Example #6
0
        public void ShouldReturnFalseWhenJsonIsValidButDepthIsOne()
        {
            var json = JsonUtils.ReadText(JsonUtils.ValidJsonFileName);

            Assert.IsFalse(JsonValidator.IsValid(json, 1));
        }
Example #7
0
        public void ShouldReturnFalseWhenJsonIsInvalid()
        {
            var json = JsonUtils.ReadText(JsonUtils.InvalidJsonFileName);

            Assert.IsFalse(JsonValidator.IsValid(json));
        }