Exemplo n.º 1
0
        public void SetUp()
        {
            var retriever = new SwaggerRetriever(JsonMetadataTests.ApiMetadataConfiguration);

            var metadataRetriever = new SwaggerMetadataRetriever(
                JsonMetadataTests.ApiMetadataConfiguration, retriever,
                new List <string>());

            var jfactory = new JsonMetadataFactory(metadataRetriever);

            _jsonMetadata = jfactory.GetMetadata().ToList();

            var ssbuilder = new SchemaSetFactory(new XsdStreamsRetriever(JsonMetadataTests.XmlMetadataConfiguration));
            var xfactory  = new XsdMetadataFactory(ssbuilder.GetSchemaSet());

            _xmlMetadata = xfactory.GetMetadata().ToList();

            var strategies = new List <IMetadataMapper>
            {
                //new DiminishingMetadataMapper(),
                new PremappedLookupMetadataMapper(), new LookupDoNotMapPropertyMapper(),

                //new ArrayMetadataMapper(),
                new DescriptorReferenceMetadataMapper(), new NameMatchingMetadataMapper()

                //new SchoolIdBugFixMetadataMapper()
            };

            var factory = new LookupToGetByExampleMetadataMappingFactory(_xmlMetadata, _jsonMetadata, strategies);

            _mappings = factory.GetMetadataMappings().ToArray();
        }
        public void SetUp()
        {
            var retriever = new SwaggerRetriever(JsonMetadataTests.ApiMetadataConfiguration);

            var metadataRetriever = new SwaggerMetadataRetriever(
                JsonMetadataTests.ApiMetadataConfiguration, retriever,
                new List <string>());

            var ssbuilder = new SchemaSetFactory(new XsdStreamsRetriever(JsonMetadataTests.XmlMetadataConfiguration));
            var xfactory  = new XsdApiTypesMetadataFactory(ssbuilder.GetSchemaSet());

            _xmlMetadata = xfactory.GetMetadata().ToList();

            var jfactory = new JsonMetadataFactory(metadataRetriever);

            _jsonMetadata = jfactory.GetMetadata().ToList();

            var strategies = new IMetadataMapper[]
            {
                new ArrayMetadataMapper(), new DescriptorReferenceMetadataMapper(), new NameMatchingMetadataMapper()
            };

            var factory = new ResourceToResourceMetadataMappingFactory(
                _xmlMetadata.AsEnumerable(),
                _jsonMetadata.AsEnumerable(), strategies);

            _mappings = factory.GetMetadataMappings().ToArray();
        }