public ESDATChemistryMapperFactory(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List<IResult> results)
        {
            this.WQDefaultValueProvider = WQDefaultValueProvider;

            ActionMapper = new ChemistryActionMapper(duplicateChecker, this, WQDefaultValueProvider, wayToHandleNewData, results);
            ActionByMapper = new ActionByMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);

            AffiliationMapper = new AffiliationMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            AffiliationMapper.BackingStore = new List<Affiliation>();

            DatasetMapper = new DatasetMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            DatasetMapper.BackingStore = new List<Dataset>();

            DatasetsResultMapper = new DatasetsResultMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            FeatureActionMapper = new ChemistryFeatureActionMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            
            MeasurementResultMapper = new ChemistryMeasurementResultMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            MeasurementResultValueMapper = new ChemistryMeasurementResultValueMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);

            MethodMapper = new ChemistryMethodMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            MethodMapper.BackingStore = new List<Method>();

            OrganizationMapper = new ChemistryOrganizationMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            OrganizationMapper.BackingStore = new List<Organization>();

            PersonMapper = new PersonMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            PersonMapper.BackingStore = new List<Person>();

            ProcessingLevelMapper = new ProcessingLevelMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            ProcessingLevelMapper.BackingStore = new List<ProcessingLevel>();

            RelatedActionMapper = new RelatedActionMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            ResultMapper = new ChemistryResultMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);

            SamplingFeatureMapper = new ChemistrySamplingFeatureMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            SamplingFeatureMapper.BackingStore = new List<SamplingFeature>();

            UnitMapper = new ChemistryUnitMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            UnitMapper.BackingStore = new List<Unit>();

            VariableMapper = new ChemistryVariableMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            VariableMapper.BackingStore = new List<Variable>();

            ResultExtensionPropertyValueMapper = new ResultExtensionPropertyValueMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);

            ExtensionPropertyMapper = new ExtensionPropertyMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);
            ExtensionPropertyMapper.BackingStore = new List<ExtensionProperty>();
        }
        public void ScaffoldTest()
        {
            var chemistry = new ChemistryFileData();

            var esdatModel = new ESDATModel();
            var sample = new SampleFileData();
            var mockDb = new Mock<IDbContext>();
            var mockDbContext = mockDb.Object;
            var duplicateChecker = new ODM2DuplicateChecker(mockDbContext);
            var defaultValueProvider = new StaticWQDefaultValueProvider();
            var wayToHandleNewData = WayToHandleNewData.ThrowExceptionForNewData;
            var results = new List<IResult>();
            var mapper = new ChemistryMethodMapper(duplicateChecker, defaultValueProvider, wayToHandleNewData, results);

            var method = mapper.Draft(esdatModel, chemistry);

            Assert.AreEqual(defaultValueProvider.DefaultMethodTypeCVChemistry, method.MethodTypeCV);
            Assert.AreEqual(chemistry.MethodType, method.MethodCode);
            Assert.AreEqual(chemistry.MethodName, method.MethodName);
        }
Ejemplo n.º 3
0
        public void ScaffoldTest()
        {
            var chemistry = new ChemistryFileData();

            var esdatModel           = new ESDATModel();
            var sample               = new SampleFileData();
            var mockDb               = new Mock <IDbContext>();
            var mockDbContext        = mockDb.Object;
            var duplicateChecker     = new ODM2DuplicateChecker(mockDbContext);
            var defaultValueProvider = new StaticWQDefaultValueProvider();
            var wayToHandleNewData   = WayToHandleNewData.ThrowExceptionForNewData;
            var results              = new List <IResult>();
            var mapper               = new ChemistryMethodMapper(duplicateChecker, defaultValueProvider, wayToHandleNewData, results);

            var method = mapper.Draft(esdatModel, chemistry);

            Assert.AreEqual(defaultValueProvider.DefaultMethodTypeCVChemistry, method.MethodTypeCV);
            Assert.AreEqual(chemistry.MethodType, method.MethodCode);
            Assert.AreEqual(chemistry.MethodName, method.MethodName);
        }