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>();
        }
        public void ScaffoldTest()
        {
            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;
            //duplicateChecker.SampleFileData = sample;
            var results = new List <IResult>();
            var mapper  = new SampleCollectionResultMapper(duplicateChecker, defaultValueProvider, wayToHandleNewData, results);

            mapper.Sample = sample;
            var result = mapper.Draft(esdatModel);

            Assert.AreEqual(defaultValueProvider.ResultTypeCVSampleCollection, result.ResultTypeCV);
            Assert.AreEqual(sample.SampledDateTime, result.ResultDateTime);
            Assert.AreEqual(defaultValueProvider.ResultSampledMediumCVSampleCollection, result.SampledMediumCV);
            Assert.AreEqual(1, result.ValueCount);
        }
        public void ScaffoldTest()
        {
            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;
            //duplicateChecker.SampleFileData = sample;
            var results = new List<IResult>();
            var mapper = new SampleCollectionResultMapper(duplicateChecker, defaultValueProvider, wayToHandleNewData, results);

            mapper.Sample = sample;
            var result = mapper.Draft(esdatModel);

            Assert.AreEqual(defaultValueProvider.ResultTypeCVSampleCollection, result.ResultTypeCV);
            Assert.AreEqual(sample.SampledDateTime, result.ResultDateTime);
            Assert.AreEqual(defaultValueProvider.ResultSampledMediumCVSampleCollection, result.SampledMediumCV);
            Assert.AreEqual(1, result.ValueCount);
        }