Example #1
0
        public void IsValidInvalidDefault()
        {
            ConfigurationDefinition config = new ConfigurationDefinition("form", "{ \"schema\": \"\" }", typeof(int), "test");

            IResult <bool> result = config.IsValid();

            Assert.False(result.ReturnValue);
            Assert.True(result.GetLastError().Contains("Default"));
        }
Example #2
0
        public void IsValidInvalidSchema()
        {
            ConfigurationDefinition config = new ConfigurationDefinition("{ \"form\": \"\" }", "schema", typeof(int), 1);

            IResult <bool> result = config.IsValid();

            Assert.False(result.ReturnValue);
            Assert.True(result.GetLastError().Contains("Schema"));
        }
Example #3
0
        public void IsValidInvalidModel()
        {
            ConfigurationDefinition config = new ConfigurationDefinition("form", "{ \"schema\": \"\" }", null, null);

            IResult <bool> result = config.IsValid();

            Assert.False(result.ReturnValue);
            Assert.True(result.GetLastError().Contains("Model"));
        }
Example #4
0
        public void IsValid()
        {
            ConfigurationDefinition config = new ConfigurationDefinition("{ \"form\": \"\" }", "{ \"schema\": \"\" }", typeof(int), 1);

            Assert.True(config.IsValid().ReturnValue);
        }