public void ExtractESDATDataFromNoHeaderFileTest()
        {
            var mockDefaultValueProvider = new Mock<IWQDefaultValueProvider>();
            mockDefaultValueProvider.Setup(x => x.OrganizationNameSampleCollection).Returns("Default organization name from provider");

            var chemistryFileToImport = CreateCSVDataToImport(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DataFiles", "ChemistryFileExample.csv"));
            var sampleFileToImport = CreateCSVDataToImport(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DataFiles", "SampleFileExample.csv"));

            var testESDATDataToImport = new ESDATDataToImport(null, sampleFileToImport, chemistryFileToImport);
            var simpleValueAssginer = new SimpleValueAssigner();

            var sampleDataImporter = ESDATTestHelper.BuildSampleDataFileImporter();
            var sampleFileChildObjectExtractConfiguration = new SampleFileChildObjectExtractConfiguration(sampleDataImporter, "SampleFileData", simpleValueAssginer);

            var chemistryDataImporter = ESDATTestHelper.BuildChemistryFileImporter();
            var chemistryFileChildObjectExtractConfiguration = new ChemistryFileChildObjectExtractConfiguration(chemistryDataImporter, "ChemistryData", simpleValueAssginer);

            var testESDATDataImporter = new ESDATDataImporter(ResultLevel.ERROR, mockDefaultValueProvider.Object);

            AddXMLExtractConfigurationsToImporter(testESDATDataImporter);
            testESDATDataImporter.AddExtractConfiguration(sampleFileChildObjectExtractConfiguration);
            testESDATDataImporter.AddExtractConfiguration(chemistryFileChildObjectExtractConfiguration);

            var extractResult = testESDATDataImporter.Extract<ESDATModel>(testESDATDataToImport);

            Assert.NotNull(extractResult);

            var entity = extractResult.ExtractedEntities.Cast<ESDATModel>().SingleOrDefault();

            Assert.NotNull(entity);
            Assert.AreEqual("Default organization name from provider", entity.LabName);
            Assert.AreEqual(3, entity.SampleFileData.Count());
            Assert.AreEqual(9, entity.ChemistryData.Count());
        }
        public static IDataImporter BuildESDATDataImporter(IWQDefaultValueProvider wqDefaultValueProvider)
        {
            var simpleValueAssginer = new SimpleValueAssigner();

            var sampleDataImporter = BuildSampleDataFileImporter();
            var sampleFileChildObjectExtractConfiguration = new SampleFileChildObjectExtractConfiguration(sampleDataImporter, "SampleFileData", simpleValueAssginer);

            var chemistryDataImporter = BuildChemistryFileImporter();
            var chemistryFileChildObjectExtractConfiguration = new ChemistryFileChildObjectExtractConfiguration(chemistryDataImporter, "ChemistryData", simpleValueAssginer);

            var ESDATDataImporter = new ESDATDataImporter(ResultLevel.ERROR, wqDefaultValueProvider);

            AddXMLExtractConfigurationsToImporter(ESDATDataImporter);
            ESDATDataImporter.AddExtractConfiguration(sampleFileChildObjectExtractConfiguration);
            ESDATDataImporter.AddExtractConfiguration(chemistryFileChildObjectExtractConfiguration);

            return ESDATDataImporter;
        }
        public void ChemistryFilePropertyTest()
        {
            var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DataFiles", "ChemistryFileExample.csv");
            var dataSource = new WindowsFileSystem(path);
            var dataFromFileSystem = dataSource.FetchData();
            var dataToImport = new CSVDataToImport(dataFromFileSystem);

            var simpleValueAssginer = new SimpleValueAssigner();

            var chemistryImporter = ESDATTestHelper.BuildChemistryFileImporter();

            var childObjectExtractConfiguration = new ChemistryFileChildObjectExtractConfiguration(chemistryImporter, "ChemistryData", simpleValueAssginer);

            Assert.AreEqual(typeof(ChemistryFileData), childObjectExtractConfiguration.ChildObjectType);

            var testESDATModel = new ESDATModel();

            var extractResult = childObjectExtractConfiguration.ExtractData(testESDATModel, dataToImport);

            Assert.NotNull(extractResult);
            Assert.AreEqual(9, testESDATModel.ChemistryData.Count());
        }
        public static IExtractConfiguration CreateChemistryFileDataExtractConfiguration()
        {
            var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DataFiles", "ChemistryFileExample.csv");
            var dataSource = new WindowsFileSystem(path);
            var dataFromFileSystem = dataSource.FetchData();
            var dataToImport = new CSVDataToImport(dataFromFileSystem);

            var simpleValueAssginer = new SimpleValueAssigner();

            var chemistryImporter = ESDATTestHelper.BuildChemistryFileImporter();

            var childObjectExtractConfiguration = new ChemistryFileChildObjectExtractConfiguration(chemistryImporter, "ChemistryData", simpleValueAssginer);

            return childObjectExtractConfiguration;
        }