public ESDATSampleCollectionMapperFactory(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List<IResult> results)
        {
            this.WQDefaultValueProvider = WQDefaultValueProvider;
            
            var chemistryFactory = new ESDATChemistryMapperFactory(duplicateChecker, 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 SampleCollectionFeatureActionMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);

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

            OrganizationMapper = new SampleCollectionOrganizationMapper(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 SampleCollectionResultMapper(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results);

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

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

            VariableMapper = new SampleCollectionVariableMapper(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>();
        }
Exemple #2
0
        public void ScaffoldTest()
        {
            var esdatModel = new ESDATModel();

            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 SampleCollectionFeatureActionMapper(duplicateChecker, defaultValueProvider, wayToHandleNewData, results);

            var featureAction = mapper.Draft(esdatModel);

            Assert.AreEqual(0, featureAction.FeatureActionID);
            Assert.AreEqual(0, featureAction.SamplingFeatureID);
            Assert.AreEqual(0, featureAction.ActionID);
        }