예제 #1
0
        protected override void Context()
        {
            _view                = A.Fake <ISelectEventAssignmentTargetView>();
            _context             = A.Fake <IMoBiContext>();
            _objectBaseDTOMapper = A.Fake <IObjectBaseToObjectBaseDTOMapper>();
            _containerDTOMapper  = A.Fake <IContainerToContainerDTOMapper>();
            _reactionMapper      = A.Fake <IReactionBuilderToDummyReactionDTOMapper>();
            _moleculeMapper      = A.Fake <IMoleculeBuilderToDummyMoleculeDTOMapper>();
            _objectPathFactory   = A.Fake <IObjectPathFactory>();
            _parameterMapper     = A.Fake <IParameterToDummyParameterDTOMapper>();
            _dimensionRetriever  = A.Fake <IReactionDimensionRetriever>();
            sut = new SelectEventAssingmentTargetPresenter(_view, _context, _objectBaseDTOMapper, _containerDTOMapper, _reactionMapper,
                                                           _moleculeMapper, _objectPathFactory, _parameterMapper, _dimensionRetriever);

            _mobiProject     = A.Fake <IMoBiProject>();
            _rootContainer   = new Container();
            _moleculeBuilder = new MoleculeBuilder().WithName("M");
            _reaction        = new ReactionBuilder().WithName("R");
            _localParameter  = new Parameter().WithMode(ParameterBuildMode.Local).WithName("LocalParam");
            _globalParameter = new Parameter().WithMode(ParameterBuildMode.Global).WithName("GlobalParam");
            _reaction.Add(_localParameter);
            _reaction.Add(_globalParameter);
            _reactionBB = new MoBiReactionBuildingBlock()
            {
                _reaction
            };
            _moleculeBB = new MoleculeBuildingBlock {
                _moleculeBuilder
            };
            A.CallTo(() => _mobiProject.ReactionBlockCollection).Returns(new [] { _reactionBB });
            A.CallTo(() => _mobiProject.MoleculeBlockCollection).Returns(new [] { _moleculeBB });
            sut.Init(_mobiProject, _rootContainer);
        }
        protected override void Context()
        {
            _formulaCache      = A.Fake <IFormulaCache>();
            _repository        = A.Fake <IRepository <IInteractionKineticUpdaterSpecification> >();
            _objectBaseFactory = A.Fake <IObjectBaseFactory>();
            A.CallTo(() => _objectBaseFactory.Create <ExplicitFormula>()).ReturnsLazily(x => new ExplicitFormula());
            A.CallTo(() => _repository.All()).Returns(_allKineticUpdaterSpecifications);
            sut = new InteractionKineticUpdater(_repository, _objectBaseFactory);

            _reaction = new ReactionBuilder();
            _transporterMoleculeContainer = new TransporterMoleculeContainer();
            _simulation            = A.Fake <Simulation>();
            _interactionProperties = new InteractionProperties();

            _interactionProperties.AddInteraction(new InteractionSelection {
                MoleculeName = _enzymeName, ProcessName = _processName
            });
            A.CallTo(() => _simulation.InteractionProperties).Returns(_interactionProperties);


            _kmFactor   = new PKSimParameter().WithName(CoreConstants.Parameter.KM_INTERACTION_FACTOR).WithFormula(new ExplicitFormula("1"));
            _vmaxFactor = new PKSimParameter().WithName(CoreConstants.Parameter.KCAT_INTERACTION_FACTOR).WithFormula(new ExplicitFormula("1"));

            _reaction.Add(_kmFactor);
            _reaction.Add(_vmaxFactor);

            _transporterMoleculeContainer.Add(_kmFactor);
            _transporterMoleculeContainer.Add(_vmaxFactor);
        }