Ejemplo n.º 1
0
        public void IndirectAttributeHandler()
        {
            AttributeHandler.RemoveHandler <CustomAttributeHandler>();
            AttributeHandler.AddHandler <CustomAttributeHandler>();

            JsonSchema expected = new JsonSchemaBuilder()
                                  .Type(SchemaValueType.Object)
                                  .Properties(
                ("MyProperty", new JsonSchemaBuilder().Type(SchemaValueType.String).MaxLength(AttributeWithIndirectHandler.MaxLength))
                );

            JsonSchema actual = new JsonSchemaBuilder().FromType <TypeWithCustomAttribute2>();

            Assert.AreEqual(expected, actual);
        }