コード例 #1
0
 public IndividualOtherProteinExpressionsPresenter(IIndividualProteinExpressionsView view,
                                                   IIndividualProteinToIndividualProteinDTOMapper individualProteinMapper,
                                                   IIndividualMoleculePropertiesPresenter <TSimulationSubject> moleculePropertiesPresenter,
                                                   IExpressionLocalizationPresenter <TSimulationSubject> expressionLocalizationPresenter,
                                                   IExpressionParametersPresenter expressionParametersPresenter)
     : base(view, individualProteinMapper, moleculePropertiesPresenter, expressionLocalizationPresenter, expressionParametersPresenter)
 {
 }
 protected IndividualProteinExpressionsPresenter(
     IIndividualProteinExpressionsView view,
     IIndividualProteinToIndividualProteinDTOMapper individualProteinMapper,
     IIndividualMoleculePropertiesPresenter <TSimulationSubject> moleculePropertiesPresenter,
     IExpressionLocalizationPresenter <TSimulationSubject> expressionLocalizationPresenter,
     IExpressionParametersPresenter expressionParametersPresenter)
     : base(view)
 {
     _individualProteinMapper         = individualProteinMapper;
     _moleculePropertiesPresenter     = moleculePropertiesPresenter;
     _expressionLocalizationPresenter = expressionLocalizationPresenter;
     _expressionParametersPresenter   = expressionParametersPresenter;
     _expressionLocalizationPresenter.LocalizationChanged += (o, e) => onLocalizationChanged();
     AddSubPresenters(_moleculePropertiesPresenter, _expressionLocalizationPresenter, _expressionParametersPresenter);
     view.AddMoleculePropertiesView(_moleculePropertiesPresenter.View);
     view.AddLocalizationView(_expressionLocalizationPresenter.View);
     view.AddExpressionParametersView(_expressionParametersPresenter.View);
 }
        protected override void Context()
        {
            _view = A.Fake <IIndividualProteinExpressionsView>();
            _individualProteinMapper         = A.Fake <IIndividualProteinToIndividualProteinDTOMapper>();
            _moleculesPropertiesPresenter    = A.Fake <IIndividualMoleculePropertiesPresenter <Individual> >();
            _expressionLocalizationPresenter = A.Fake <IExpressionLocalizationPresenter <Individual> >();
            _expressionParametersPresenter   = A.Fake <IExpressionParametersPresenter>();

            sut = new IndividualEnzymeExpressionsPresenter <Individual>(
                _view, _individualProteinMapper,
                _moleculesPropertiesPresenter,
                _expressionLocalizationPresenter,
                _expressionParametersPresenter);


            _individual           = new Individual();
            sut.SimulationSubject = _individual;


            _enzyme = new IndividualEnzyme().WithName("CYP3A4");

            _enzymeDTO            = new IndividualProteinDTO(_enzyme);
            _initialConcentration = createParameter(INITIAL_CONCENTRATION);
            _relativeExpression   = createParameter(REL_EXP);
            _relativeExpression2  = createParameter(REL_EXP);
            _fraction_exp_bc      = createParameter(FRACTION_EXPRESSED_BLOOD_CELLS);
            _enzymeDTO.AddExpressionParameter(_initialConcentration);
            _enzymeDTO.AddExpressionParameter(_relativeExpression);
            _enzymeDTO.AddExpressionParameter(_fraction_exp_bc);
            A.CallTo(() => _individualProteinMapper.MapFrom(_enzyme, _individual)).Returns(_enzymeDTO);
            A.CallTo(() => _expressionParametersPresenter.Edit(A <IReadOnlyList <ExpressionParameterDTO> > ._))
            .Invokes(x => _allParameters = x.GetArgument <IReadOnlyList <ExpressionParameterDTO> >(0).ToList());


            sut.ActivateMolecule(_enzyme);
        }