private IDimensionConverterFor createFieldConverterFor(IQuantityField quantityField, IPopulationDataCollector populationDataCollector = null) { var dimension = quantityField.Dimension; if (dimension == DimensionRepository.MolarConcentration) { return(new MolarToMassConcentrationDimensionForFieldConverter(quantityField, populationDataCollector, DimensionRepository)); } if (dimension == DimensionRepository.Amount) { return(new MolarToMassAmoutDimensionForFieldConverter(quantityField, populationDataCollector, DimensionRepository)); } if (dimension == DimensionRepository.AucMolar) { return(new AucMolarToAucMassDimensionForFieldConverter(quantityField, populationDataCollector, DimensionRepository)); } if (dimension == DimensionRepository.MassConcentration) { return(new MassToMolarConcentrationDimensionForFieldConverter(quantityField, populationDataCollector, DimensionRepository)); } return(null); }
protected override void Context() { _quantityField = A.Fake <IQuantityField>(); _dimensionRepository = A.Fake <IDimensionRepository>(); _populationDataCollector = A.Fake <IPopulationDataCollector>(); _quantityField.QuantityPath = "Quantity"; sut = new MolarToMassAmoutDimensionForFieldConverter(_quantityField, _populationDataCollector, _dimensionRepository); }
private void mapQuantityFieldToModel(PopulationAnalysisField snapshot, IQuantityField field) { mapNumericFieldToModel(snapshot, field); field.QuantityPath = snapshot.QuantityPath; if (snapshot.QuantityType != null) { field.QuantityType = snapshot.QuantityType.Value; } }
protected FieldDimensionConverter(IQuantityField quantityField, IPopulationDataCollector populationDataCollector, IDimension sourceDimension, IDimension targetDimension) : base(sourceDimension, targetDimension) { _quantityField = quantityField; _populationDataCollector = populationDataCollector; }
private void mapQuantityFieldToSnapshot(PopulationAnalysisField snapshot, IQuantityField field) { mapNumericFieldToSnapshot(snapshot, field); snapshot.QuantityPath = field.QuantityPath; snapshot.QuantityType = field.QuantityType; }
protected MolarToMassFieldDimensionConverter(IQuantityField quantityField, IPopulationDataCollector populationDataCollector, IDimension molarDimension, IDimension massDimension) : base(quantityField, populationDataCollector, molarDimension, massDimension) { }
public AucMolarToAucMassDimensionForFieldConverter(IQuantityField quantityField, IPopulationDataCollector populationDataCollector, IDimensionRepository dimensionRepository) : base(quantityField, populationDataCollector, dimensionRepository.AucMolar, dimensionRepository.Auc) { }
public MolarToMassAmountDimensionForFieldConverter(IQuantityField quantityField, IPopulationDataCollector populationDataCollector, IDimensionRepository dimensionRepository) : base(quantityField, populationDataCollector, dimensionRepository.Amount, dimensionRepository.Mass) { }
public MolarToMassConcentrationDimensionForFieldConverter(IQuantityField quantityField, IPopulationDataCollector populationDataCollector, IDimensionRepository dimensionRepository) : base(quantityField, populationDataCollector, dimensionRepository.MolarConcentration, dimensionRepository.MassConcentration) { }
protected MassToMolarFieldDimensionConverter(IQuantityField quantityField, IPopulationDataCollector populationDataCollector, IDimension sourceDimension, IDimension targetDimension) : base(quantityField, populationDataCollector, sourceDimension, targetDimension) { }