示例#1
0
 protected override void Context()
 {
     _originDataMapper        = A.Fake <IIndividualSettingsDTOToOriginDataMapper>();
     _individualModelTask     = A.Fake <IIndividualModelTask>();
     _parameterMapper         = A.Fake <IParameterToParameterDTOMapper>();
     _originDataTask          = A.Fake <IOriginDataTask>();
     _subPopulationMapper     = A.Fake <ISubPopulationToSubPopulationDTOMapper>();
     _calculationMethodMapper = A.Fake <ICalculationMethodToCategoryCalculationMethodDTOMapper>();
     _populationRepository    = A.Fake <IPopulationRepository>();
     sut = new IndividualDefaultValueRetriever(_individualModelTask, _originDataMapper, _parameterMapper,
                                               _originDataTask, _subPopulationMapper, _speciesRepository,
                                               _calculationMethodMapper, _populationRepository);
 }
示例#2
0
 public IndividualDefaultValueRetriever(IIndividualModelTask individualModelTask,
                                        IIndividualSettingsDTOToOriginDataMapper originDataMapper,
                                        IParameterToParameterDTOMapper parameterMapper,
                                        IOriginDataTask originDataTask,
                                        ISubPopulationToSubPopulationDTOMapper subPopulationDTOMapper,
                                        ISpeciesRepository speciesRepository,
                                        ICalculationMethodToCategoryCalculationMethodDTOMapper calculationMethodDTOMapper, IPopulationRepository populationRepository)
 {
     _individualModelTask        = individualModelTask;
     _originDataMapper           = originDataMapper;
     _parameterMapper            = parameterMapper;
     _originDataTask             = originDataTask;
     _subPopulationDTOMapper     = subPopulationDTOMapper;
     _speciesRepository          = speciesRepository;
     _calculationMethodDTOMapper = calculationMethodDTOMapper;
     _populationRepository       = populationRepository;
 }
示例#3
0
 public OriginDataMapper(
     ParameterMapper parameterMapper,
     CalculationMethodCacheMapper calculationMethodCacheMapper,
     ValueOriginMapper valueOriginMapper,
     IOriginDataTask originDataTask,
     IDimensionRepository dimensionRepository,
     IIndividualModelTask individualModelTask,
     ISpeciesRepository speciesRepository
     )
 {
     _dimensionRepository          = dimensionRepository;
     _speciesRepository            = speciesRepository;
     _parameterMapper              = parameterMapper;
     _originDataTask               = originDataTask;
     _individualModelTask          = individualModelTask;
     _calculationMethodCacheMapper = calculationMethodCacheMapper;
     _valueOriginMapper            = valueOriginMapper;
 }
 public IndividualDefaultValuesUpdater(
     IIndividualModelTask individualModelTask,
     IIndividualSettingsDTOToOriginDataMapper originDataMapper,
     IParameterToParameterDTOMapper parameterMapper,
     IOriginDataTask originDataTask,
     ISubPopulationToSubPopulationDTOMapper subPopulationDTOMapper,
     ICalculationMethodToCategoryCalculationMethodDTOMapper calculationMethodDTOMapper,
     IPopulationRepository populationRepository,
     ICloner cloner,
     IDiseaseStateRepository diseaseStateRepository)
 {
     _individualModelTask        = individualModelTask;
     _originDataMapper           = originDataMapper;
     _parameterMapper            = parameterMapper;
     _originDataTask             = originDataTask;
     _subPopulationDTOMapper     = subPopulationDTOMapper;
     _calculationMethodDTOMapper = calculationMethodDTOMapper;
     _populationRepository       = populationRepository;
     _cloner = cloner;
     _diseaseStateRepository = diseaseStateRepository;
 }
示例#5
0
 protected override void Context()
 {
     _speciesRepository   = A.Fake <ISpeciesRepository>();
     _originDataTask      = A.Fake <IOriginDataTask>();
     _individualModelTask = A.Fake <IIndividualModelTask>();
     _male   = new Gender().WithName(CoreConstants.Gender.Male);
     _female = new Gender().WithName(CoreConstants.Gender.Female);
     _human  = new Species().WithName(CoreConstants.Species.Human);
     _icrp   = new SpeciesPopulation {
         IsHeightDependent = true, IsAgeDependent = true
     }.WithName(CoreConstants.Population.ICRP);
     _anotherPop = new SpeciesPopulation().WithName("Another Pop");
     _cmForHuman = new CalculationMethod();
     _cmForHuman.AddSpecies(_human.Name);
     _icrp.AddGender(_male);
     _human.AddPopulation(_icrp);
     _category = new CalculationMethodCategory();
     _category.Add(_cmForHuman);
     A.CallTo(() => _speciesRepository.All()).Returns(new[] { _human });
     A.CallTo(() => _originDataTask.AllCalculationMethodCategoryFor(_human)).Returns(new[] { _category });
     _batchOriginData = new OriginData();
     sut = new OriginDataMapper(_speciesRepository, _originDataTask, _individualModelTask);
 }
示例#6
0
        protected override Task Context()
        {
            _parameterMapper = A.Fake <ParameterMapper>();
            _calculationMethodCacheMapper = A.Fake <CalculationMethodCacheMapper>();
            _originDataTask      = A.Fake <IOriginDataTask>();
            _dimensionRepository = A.Fake <IDimensionRepository>();
            _individualModelTask = A.Fake <IIndividualModelTask>();
            _speciesRepository   = A.Fake <ISpeciesRepository>();
            _valueOriginMapper   = A.Fake <ValueOriginMapper>();

            sut = new OriginDataMapper(_parameterMapper, _calculationMethodCacheMapper, _valueOriginMapper, _originDataTask, _dimensionRepository, _individualModelTask, _speciesRepository);

            _ageSnapshotParameter = new Parameter {
                Value = 1
            };
            _heightSnapshotParameter = new Parameter {
                Value = 2
            };
            _weightSnapshotParameter = new Parameter {
                Value = 3
            };
            _gestationalAgeSnapshotParameter = new Parameter {
                Value = 4
            };

            _speciesPopulation = new SpeciesPopulation {
                Name = "SpeciesPopulation", IsHeightDependent = true, IsAgeDependent = true
            };
            _gender = new Gender {
                Name = "Unknown"
            };
            _species = new Species {
                Name = "Human"
            };
            _species.AddPopulation(_speciesPopulation);
            _anotherPopulation = new SpeciesPopulation {
                Name = "Another species population", IsHeightDependent = true, IsAgeDependent = true
            };

            _speciesPopulation.AddGender(_gender);
            _anotherGender = new Gender {
                Name = "AnotherGender"
            };

            A.CallTo(() => _speciesRepository.All()).Returns(new[] { _species });

            _originData = new Model.OriginData
            {
                Age               = 35,
                AgeUnit           = "years",
                Height            = 17.8,
                HeightUnit        = "m",
                Weight            = 73,
                WeightUnit        = "kg",
                Species           = _species,
                SpeciesPopulation = _speciesPopulation,
                Gender            = _gender,
                GestationalAge    = 40
            };

            A.CallTo(() => _parameterMapper.ParameterFrom(null, A <string> ._, A <IDimension> ._)).Returns(null);
            A.CallTo(() => _parameterMapper.ParameterFrom(_originData.Age, A <string> ._, A <IDimension> ._)).Returns(_ageSnapshotParameter);
            A.CallTo(() => _parameterMapper.ParameterFrom(_originData.Height, A <string> ._, A <IDimension> ._)).Returns(_heightSnapshotParameter);
            A.CallTo(() => _parameterMapper.ParameterFrom(_originData.Weight, A <string> ._, A <IDimension> ._)).Returns(_weightSnapshotParameter);
            A.CallTo(() => _parameterMapper.ParameterFrom(_originData.GestationalAge, A <string> ._, A <IDimension> ._)).Returns(_gestationalAgeSnapshotParameter);


            _valueOriginSnapshot = new ValueOrigin();
            A.CallTo(() => _valueOriginMapper.MapToSnapshot(_originData.ValueOrigin)).Returns(_valueOriginSnapshot);
            return(_completed);
        }
示例#7
0
 public OriginDataMapper(ISpeciesRepository speciesRepository, IOriginDataTask originDataTask, IIndividualModelTask individualModelTask)
 {
     _speciesRepository   = speciesRepository;
     _originDataTask      = originDataTask;
     _individualModelTask = individualModelTask;
 }