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>(); }
//Commment this out so auto-build would not run this unit test //[Test] //[TestCase(WayToHandleNewData.CreateInstanceForNewData)] //[TestCase(WayToHandleNewData.WarningForNewData)] public void ResultsTest(WayToHandleNewData wayToHandleNewData) { var dbContext = new Mock<IDbContext>().Object; var duplicateChecker = new ODM2DuplicateChecker(dbContext); var esdatModel = extractEsdatModel(); var WQDefaultValueProvider = new StaticWQDefaultValueProvider(); var results = new List<IResult>(); var sampleCollectionFactory = new ESDATSampleCollectionMapperFactory(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results); var chemistryFactory = new ESDATChemistryMapperFactory(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results); var mapper = new SampleCollectionActionMapper(duplicateChecker, sampleCollectionFactory, WQDefaultValueProvider, chemistryFactory, wayToHandleNewData, results); var converter = new ESDATConverter(mapper); var resultsList = converter.Convert(esdatModel); var errorCount = 0; var warningCount = 0; foreach (IResult result in resultsList) { Console.WriteLine(result.Level + ": " + result.Message); if (result.Level.Equals(ResultLevel.ERROR) || result.Level.Equals(ResultLevel.FATAL)) { errorCount++; } else if (result.Level.Equals(ResultLevel.WARN)) { warningCount++; } } Console.WriteLine(String.Format("{0} error(s), and {1} warning(s) found.", errorCount, warningCount)); Assert.AreEqual(0, errorCount, String.Format("{0} error(s) found.", errorCount)); Assert.AreEqual(0, warningCount, String.Format("{0} warning(s) found", warningCount)); }
public ExtensionPropertyMapper(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List<IResult> results) : base(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results) { }
public MethodMapperBase(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List <IResult> results) : base(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results) { }
public ExtensionPropertyMapper(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List <IResult> results) : base(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results) { }
public ChemistryActionMapper(ODM2DuplicateChecker duplicateChecker, ESDATChemistryMapperFactory factory, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List <IResult> results) : base(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results) { _chemistryFactory = factory; }
public ProcessingLevelMapper(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List <IResult> results) : base(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results) { }
public ODM2MapperBase(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List <IResult> iResults) { _iResults = iResults; _duplicateChecker = duplicateChecker; _WQDefaultValueProvider = WQDefaultValueProvider; _wayToHandleNewData = wayToHandleNewData; }
public SampleCollectionVariableMapper(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List <IResult> results) : base(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results) { }
public ChemistryOrganizationMapper(ODM2DuplicateChecker duplicateChecker, IWQDefaultValueProvider WQDefaultValueProvider, WayToHandleNewData wayToHandleNewData, List <IResult> results) : base(duplicateChecker, WQDefaultValueProvider, wayToHandleNewData, results) { }
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>(); }