protected override void Context()
        {
            _compound        = new Compound();
            _view            = A.Fake <ICompoundProcessesView>();
            _commandRegister = A.Fake <ICommandCollector>();
            A.CallTo(() => _view.TreeView).Returns(A.Fake <IUxTreeView>());
            _compoundProcessTask               = A.Fake <ICompoundProcessTask>();
            _partialProcessNodeMapper          = A.Fake <IPartialProcessToTreeNodeMapper>();
            _compoundProcessPresenter          = A.Fake <ICompoundProcessPresenter>();
            _compoundEnzymaticProcessPresenter = A.Fake <IEnzymaticCompoundProcessPresenter>();
            _treeNodeFactory              = new TreeNodeFactoryForSpecs();
            _contextMenuFactory           = A.Fake <ITreeNodeContextMenuFactory>();
            _entityTask                   = A.Fake <IEntityTask>();
            _partialProcessesNode         = new RootNode(PKSimRootNodeTypes.CompoundMetabolizingEnzymes);
            _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
            _compoundParameterNodeTypeToCompoundParameterGroupPresenterMapper = A.Fake <ICompoundParameterNodeTypeToCompoundParameterGroupPresenterMapper>();

            _dialogCreator = A.Fake <IDialogCreator>();
            _noItemInSelectionPresenter = A.Fake <INoItemInSelectionPresenter>();

            sut = new CompoundProcessesPresenter(_view, _compoundProcessTask, _partialProcessNodeMapper, _treeNodeFactory,
                                                 _contextMenuFactory, _compoundProcessPresenter, _entityTask, _dialogCreator, _noItemInSelectionPresenter,
                                                 _compoundParameterNodeTypeToCompoundParameterGroupPresenterMapper, _compoundEnzymaticProcessPresenter,
                                                 new PartialProcessToRootNodeTypeMapper(), new SystemicProcessToRootNodeTypeMapper());
            sut.InitializeWith(_commandRegister);
            A.CallTo(() => _view.TreeView.NodeById(PKSimRootNodeTypes.CompoundMetabolizingEnzymes.Id)).Returns(_partialProcessesNode);
        }
 public CreateInductionProcessPresenter(ICreatePartialProcessView view, ICompoundProcessTask compoundProcessTask, IPartialProcessToPartialProcessDTOMapper partialProcessMapper, IParametersByGroupPresenter parameterEditPresenter, ICompoundProcessToCompoundProcessDTOMapper processMapper, IUsedMoleculeRepository usedMoleculeRepository, ISpeciesRepository speciesRepository)
     : base(view, compoundProcessTask, partialProcessMapper, parameterEditPresenter, processMapper, usedMoleculeRepository, speciesRepository)
 {
     view.SetIcon(ApplicationIcons.Induction);
     view.MoleculeCaption = PKSimConstants.UI.AffectedEnzymeOrTransporter;
     view.Caption         = PKSimConstants.UI.Induction;
 }
 public CompoundProcessesPresenter(ICompoundProcessesView view,
                                   ICompoundProcessTask compoundProcessTask,
                                   IPartialProcessToTreeNodeMapper partialProcessNodeMapper,
                                   ITreeNodeFactory treeNodeFactory,
                                   ITreeNodeContextMenuFactory contextMenuFactory,
                                   ICompoundProcessPresenter compoundProcessPresenter,
                                   IEntityTask entityTask, IDialogCreator dialogCreator, INoItemInSelectionPresenter noItemInSelectionPresenter,
                                   ICompoundParameterNodeTypeToCompoundParameterGroupPresenterMapper compoundParameterNodeTypeToCompoundParameterGroupPresenterMapper,
                                   IEnzymaticCompoundProcessPresenter compoundEnzymaticProcessPresenter,
                                   IPartialProcessToRootNodeTypeMapper partialProcessToRootNodeTypeMapper,
                                   ISystemicProcessToRootNodeTypeMapper systemicProcessToRootNodeTypeMapper)
     : base(view)
 {
     _compoundProcessTask      = compoundProcessTask;
     _partialProcessNodeMapper = partialProcessNodeMapper;
     _treeNodeFactory          = treeNodeFactory;
     _contextMenuFactory       = contextMenuFactory;
     _compoundProcessPresenter = compoundProcessPresenter;
     _entityTask    = entityTask;
     _dialogCreator = dialogCreator;
     _noItemInSelectionPresenter             = noItemInSelectionPresenter;
     _noItemInSelectionPresenter.Description = PKSimConstants.Information.CompoundProcessesInfo;
     _compoundParameterNodeTypeToCompoundParameterGroupPresenterMapper = compoundParameterNodeTypeToCompoundParameterGroupPresenterMapper;
     _compoundEnzymaticProcessPresenter   = compoundEnzymaticProcessPresenter;
     _parameterPresenterCache             = new Cache <CompoundParameterNodeType, ICompoundParameterGroupPresenter>();
     _partialProcessToRootNodeTypeMapper  = partialProcessToRootNodeTypeMapper;
     _systemicProcessToRootNodeTypeMapper = systemicProcessToRootNodeTypeMapper;
     AddSubPresenters(_compoundProcessPresenter, _compoundEnzymaticProcessPresenter, _noItemInSelectionPresenter);
 }
Пример #4
0
 public CompoundProcessPresenter(ICompoundProcessView view, IParametersByGroupPresenter parametersPresenter,
                                 IEntityTask entityTask, ISpeciesRepository speciesRepository,
                                 IRepresentationInfoRepository representationInfoRepository,
                                 ICompoundProcessToCompoundProcessDTOMapper compoundProcessDTOMapper,
                                 ICompoundProcessTask compoundProcessTask)
     : base(view, parametersPresenter, entityTask, speciesRepository, representationInfoRepository, compoundProcessDTOMapper, compoundProcessTask)
 {
 }
Пример #5
0
 protected CreateProcessPresenter(TView view, IParametersByGroupPresenter parametersPresenter, ICompoundProcessToCompoundProcessDTOMapper processMapper,
                                  ICompoundProcessTask compoundProcessTask, ISpeciesRepository speciesRepository)
     : base(view)
 {
     _parametersPresenter = parametersPresenter;
     _processMapper       = processMapper;
     _compoundProcessTask = compoundProcessTask;
     _speciesRepository   = speciesRepository;
     _view.AddParametersView(_parametersPresenter.View);
     _editCommands = new PKSimMacroCommand();
 }
 public EnzymaticCompoundProcessPresenter(
     IEnzymaticCompoundProcessView view,
     IParametersByGroupPresenter parametersPresenter,
     IEntityTask entityTask, ISpeciesRepository speciesRepository,
     IRepresentationInfoRepository representationInfoRepository,
     IEnzymaticProcessToEnzymaticProcessDTOMapper mapper,
     IBuildingBlockRepository buildingBlockRepository,
     ICompoundProcessTask processTask)
     : base(view, parametersPresenter, entityTask, speciesRepository, representationInfoRepository, mapper, processTask)
 {
     _buildingBlockRepository = buildingBlockRepository;
 }
Пример #7
0
 protected CreatePartialProcessPresenter(TView view,
                                         ICompoundProcessTask compoundProcessTask,
                                         IPartialProcessToPartialProcessDTOMapper partialProcessMapper,
                                         IParametersByGroupPresenter parameterEditPresenter,
                                         ICompoundProcessToCompoundProcessDTOMapper processMapper,
                                         IUsedMoleculeRepository usedMoleculeRepository, ISpeciesRepository speciesRepository)
     : base(view, parameterEditPresenter, processMapper, compoundProcessTask, speciesRepository)
 {
     _partialProcessMapper      = partialProcessMapper;
     _view.AllAvailableProteins = usedMoleculeRepository.All();
     DefaultMoleculeName        = string.Empty;
 }
        protected override void Context()
        {
            _enzymaticProcessToEnzymaticProcessDTOMapper = A.Fake <IEnzymaticProcessToEnzymaticProcessDTOMapper>();
            _view = A.Fake <IEnzymaticCompoundProcessView>();

            _buildingBlockRepository = A.Fake <IBuildingBlockRepository>();
            _compoundProcessTask     = A.Fake <ICompoundProcessTask>();
            sut = new EnzymaticCompoundProcessPresenter(
                _view, A.Fake <IParametersByGroupPresenter>(), A.Fake <IEntityTask>(), A.Fake <ISpeciesRepository>(), A.Fake <IRepresentationInfoRepository>(),
                _enzymaticProcessToEnzymaticProcessDTOMapper,
                _buildingBlockRepository,
                _compoundProcessTask);
        }
 protected override void Context()
 {
     base.Context();
     _view = A.Fake <ICreateEnzymaticProcessView>();
     _compoundProcessTask     = A.Fake <ICompoundProcessTask>();
     _buildingBlockRepository = A.Fake <IBuildingBlockRepository>();
     _processMapper           = A.Fake <ICompoundProcessToCompoundProcessDTOMapper>();
     _partialProcessMapper    = A.Fake <IPartialProcessToPartialProcessDTOMapper>();
     _parameterPresenter      = A.Fake <IParametersByGroupPresenter>();
     _usedMOleculeRepository  = A.Fake <IUsedMoleculeRepository>();
     _speciesRepository       = A.Fake <ISpeciesRepository>();
     sut = new CreateEnzymaticProcessPresenter(_view, _compoundProcessTask, _processMapper, _partialProcessMapper, _parameterPresenter, _usedMOleculeRepository, _speciesRepository, _buildingBlockRepository);
 }
Пример #10
0
 public CompoundMapper(ICompoundFactory compoundFactory, ICompoundProcessRepository compoundProcessRepository,
                       IBatchLogger batchLogger, ICloner cloner,
                       ICompoundCalculationMethodCategoryRepository calculationMethodCategoryRepository,
                       ICalculationMethodRepository calculationMethodRepository, ICompoundProcessTask compoundProcessTask, ISpeciesRepository speciesRepository)
 {
     _compoundFactory           = compoundFactory;
     _compoundProcessRepository = compoundProcessRepository;
     _batchLogger = batchLogger;
     _cloner      = cloner;
     _calculationMethodCategoryRepository = calculationMethodCategoryRepository;
     _calculationMethodRepository         = calculationMethodRepository;
     _compoundProcessTask = compoundProcessTask;
     _speciesRepository   = speciesRepository;
 }
 public CreateEnzymaticProcessPresenter(
     ICreateEnzymaticProcessView view,
     ICompoundProcessTask compoundProcessTask,
     ICompoundProcessToCompoundProcessDTOMapper processMapper,
     IPartialProcessToPartialProcessDTOMapper partialProcessMapper,
     IParametersByGroupPresenter parameterEditPresenter,
     IUsedMoleculeRepository usedMoleculeRepository,
     ISpeciesRepository speciesRepository,
     IBuildingBlockRepository buildingBlockRepository)
     : base(view, compoundProcessTask, partialProcessMapper, parameterEditPresenter, processMapper, usedMoleculeRepository, speciesRepository)
 {
     view.SetIcon(ApplicationIcons.Metabolite);
     view.Caption             = PKSimConstants.UI.CreateMetabolizingEnzyme;
     view.MoleculeCaption     = PKSimConstants.UI.MetabolizingEnzyme;
     _buildingBlockRepository = buildingBlockRepository;
 }
Пример #12
0
 public CompoundProcessMapper(
     ParameterMapper parameterMapper,
     IRepresentationInfoRepository representationInfoRepository,
     ICompoundProcessRepository compoundProcessRepository,
     ICloner cloner,
     ISpeciesRepository speciesRepository,
     ICompoundProcessTask compoundProcessTask,
     IOSPSuiteLogger logger
     ) : base(parameterMapper)
 {
     _representationInfoRepository = representationInfoRepository;
     _compoundProcessRepository    = compoundProcessRepository;
     _cloner              = cloner;
     _speciesRepository   = speciesRepository;
     _compoundProcessTask = compoundProcessTask;
     _logger              = logger;
 }
 protected BaseCompoundProcessPresenter(TView view,
                                        IParametersByGroupPresenter parametersPresenter,
                                        IEntityTask entityTask, ISpeciesRepository speciesRepository,
                                        IRepresentationInfoRepository representationInfoRepository,
                                        IMapper <TCompoundProcess, TProcessDTO> compoundProcessDTOMapper,
                                        ICompoundProcessTask compoundProcessTask)
     : base(view)
 {
     _parametersPresenter          = parametersPresenter;
     _entityTask                   = entityTask;
     _speciesRepository            = speciesRepository;
     _representationInfoRepository = representationInfoRepository;
     _compoundProcessDTOMapper     = compoundProcessDTOMapper;
     _processTask                  = compoundProcessTask;
     _view.SetParametersView(_parametersPresenter.View);
     AddSubPresenters(_parametersPresenter);
 }
        protected override Task Context()
        {
            _parameterMapper = A.Fake <ParameterMapper>();
            _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
            _compoundProcessRepository    = A.Fake <ICompoundProcessRepository>();
            _cloner              = A.Fake <ICloner>();
            _speciesRepository   = A.Fake <ISpeciesRepository>();
            _compoundProcessTask = A.Fake <ICompoundProcessTask>();
            _logger              = A.Fake <IOSPSuiteLogger>();


            sut = new CompoundProcessMapper(_parameterMapper, _representationInfoRepository, _compoundProcessRepository, _cloner, _speciesRepository, _compoundProcessTask, _logger);

            _enzymaticProcess = new EnzymaticProcess
            {
                Name           = "Enzymatic Process",
                Description    = "Process description",
                InternalName   = "A",
                DataSource     = "B",
                MetaboliteName = "Meta"
            };

            //Same description as DB
            A.CallTo(() => _representationInfoRepository.DescriptionFor(RepresentationObjectType.PROCESS, _enzymaticProcess.InternalName)).Returns(_enzymaticProcess.Description);

            _enzymaticProcessWithSpecies = new EnzymaticProcessWithSpecies
            {
                Name         = "Enzymatic process with species",
                Description  = "toto",
                Species      = new Species().WithName("Human"),
                InternalName = "C",
                DataSource   = "D",
            };

            A.CallTo(() => _representationInfoRepository.DescriptionFor(RepresentationObjectType.PROCESS, _enzymaticProcessWithSpecies.InternalName)).Returns("Process description");

            return(Task.FromResult(true));
        }
 public CreateSpecificBindingPartialProcessPresenter(ICreatePartialProcessView view, ICompoundProcessTask compoundProcessTask, ICompoundProcessToCompoundProcessDTOMapper processMapper, IPartialProcessToPartialProcessDTOMapper partialProcessMapper, IParametersByGroupPresenter parameterEditPresenter, IUsedMoleculeRepository usedMoleculeRepository, ISpeciesRepository speciesRepository)
     : base(view, compoundProcessTask, partialProcessMapper, parameterEditPresenter, processMapper, usedMoleculeRepository, speciesRepository)
 {
     view.SetIcon(ApplicationIcons.SpecificBinding);
     view.MoleculeCaption = PKSimConstants.UI.ProteinBindingPartner;
     view.Caption         = PKSimConstants.UI.CreateProteinBindingPartner;
 }
Пример #16
0
 public CreateSystemicProcessPresenter(ICreateSystemicProcessView view, IParametersByGroupPresenter parameterEditPresenter,
                                       ICompoundProcessToCompoundProcessDTOMapper processMapper, ICompoundProcessTask compoundProcessTask,
                                       ISpeciesRepository speciesRepository, ISystemicProcessToSystemicProcessDTOMapper systemicProcessDTOMapper) : base(view, parameterEditPresenter, processMapper, compoundProcessTask, speciesRepository)
 {
     _systemicProcessDTOMapper = systemicProcessDTOMapper;
 }
 public CreateTransportPartialProcessPresenter(ICreatePartialProcessView view, ICompoundProcessTask compoundProcessTask, ICompoundProcessToCompoundProcessDTOMapper processMapper, IPartialProcessToPartialProcessDTOMapper partialProcessMapper, IParametersByGroupPresenter parameterEditPresenter, IUsedMoleculeRepository usedMoleculeRepository, ISpeciesRepository speciesRepository)
     : base(view, compoundProcessTask, partialProcessMapper, parameterEditPresenter, processMapper, usedMoleculeRepository, speciesRepository)
 {
     view.ApplicationIcon = ApplicationIcons.Transporter;
     view.MoleculeCaption = PKSimConstants.UI.TransportProteins;
     view.Caption         = PKSimConstants.UI.CreateTransportProtein;
 }