Exemplo n.º 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"));
        }
Exemplo n.º 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"));
        }
Exemplo n.º 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"));
        }
Exemplo n.º 4
0
        public void IsValid()
        {
            ConfigurationDefinition config = new ConfigurationDefinition("{ \"form\": \"\" }", "{ \"schema\": \"\" }", typeof(int), 1);

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