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 IMetadataMapper[]
            {
                //new DiminishingMetadataMapper(),
                new PremappedLookupMetadataMapper(), new LookupDoNotMapPropertyMapper(),

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

                //new SchoolIdBugFixMetadataMapper()
            };

            var factory = new ResourceToIdentityMetadataMappingFactory(_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();
        }
Example #3
0
 public SingleAlbumDirectoryRule(IMetadataMapper metadataMapper)
 {
     if (metadataMapper == null)
     {
         throw new ArgumentNullException(nameof(metadataMapper));
     }
     m_MetadataMapper = metadataMapper;
 }
Example #4
0
 public DirectoryNameMatchesArtistNameRule(IMetadataMapper fileMetadataMapper)
 {
     if (fileMetadataMapper == null)
     {
         throw new ArgumentNullException(nameof(fileMetadataMapper));
     }
     this.m_FileMetadataMapper = fileMetadataMapper;
 }
Example #5
0
 public StructuedTextOutputWriter(IMetadataMapper metadataMapper)
 {
     if (metadataMapper == null)
     {
         throw new ArgumentNullException(nameof(metadataMapper));
     }
     m_MetadataMapper = metadataMapper;
 }
Example #6
0
 public SingleDiskFileNameRule(IMetadataMapper metadataMapper, IConfigurationMapper configurationMapper)
     : base(metadataMapper, configurationMapper)
 {
     if (metadataMapper == null)
     {
         throw new ArgumentNullException(nameof(metadataMapper));
     }
     this.m_MetadataMapper = metadataMapper;
 }
Example #7
0
        public AlbumDirectoryCoverFileRule(IMetadataMapper fileMapper, IConfigurationMapper configurationMapper)
        {
            if (fileMapper == null)
            {
                throw new ArgumentNullException(nameof(fileMapper));
            }
            if (configurationMapper == null)
            {
                throw new ArgumentNullException(nameof(configurationMapper));
            }

            m_FileMapper          = fileMapper;
            m_ConfigurationMapper = configurationMapper;
        }
Example #8
0
        public MetaDataLoader(IMetadataFactory metadataFactory, IMetadataMapper fileMetadataMapper)
        {
            if (metadataFactory == null)
            {
                throw new ArgumentNullException(nameof(metadataFactory));
            }
            if (fileMetadataMapper == null)
            {
                throw new ArgumentNullException(nameof(fileMetadataMapper));
            }

            m_MetadataFactory    = metadataFactory;
            m_FileMetadataMapper = fileMetadataMapper;
        }
Example #9
0
        protected FileNameRule(IMetadataMapper metadataMapper, IConfigurationMapper configurationMapper)
        {
            if (configurationMapper == null)
            {
                throw new ArgumentNullException(nameof(configurationMapper));
            }
            if (metadataMapper == null)
            {
                throw new ArgumentNullException(nameof(metadataMapper));
            }

            m_ConfigurationMapper = configurationMapper;
            m_MetadataMapper      = metadataMapper;
        }
Example #10
0
        public ConsistencyChecker(IMetadataMapper fileMetadataMapper, IKernel kernel, IConfigurationMapper configurationMapper, IRuleSet ruleSet)
        {
            if (fileMetadataMapper == null)
            {
                throw new ArgumentNullException(nameof(fileMetadataMapper));
            }
            if (kernel == null)
            {
                throw new ArgumentNullException(nameof(kernel));
            }
            if (configurationMapper == null)
            {
                throw new ArgumentNullException(nameof(configurationMapper));
            }
            if (ruleSet == null)
            {
                throw new ArgumentNullException(nameof(ruleSet));
            }

            m_MetadataMapper      = fileMetadataMapper;
            m_Kernel              = kernel;
            m_ConfigurationMapper = configurationMapper;
            m_RuleSet             = ruleSet;
        }