public PopulationParameterGroupsPresenter(IPopulationParameterGroupsView view, IParameterGroupTask parameterGroupTask,
                                           IPopulationGroupNodeCreator groupNodeCreator, IPopulationHierarchyNodeCreator hierarchyNodeCreator) : base(view)
 {
     _parameterGroupTask   = parameterGroupTask;
     _groupNodeCreator     = groupNodeCreator;
     _hierarchyNodeCreator = hierarchyNodeCreator;
 }
 protected override void Context()
 {
     _view                       = A.Fake <IParameterGroupsView>();
     _groupNodeCreator           = A.Fake <IParameterGroupNodeCreator>();
     _parameterGroupTask         = A.Fake <IParameterGroupTask>();
     _containerNodeMapper        = A.Fake <IParameterContainerToTreeNodeMapper>();
     _parameterPresenterMapper   = A.Fake <INodeToCustomableParametersPresenterMapper>();
     _noItemInSelectionPresenter = A.Fake <INoItemInSelectionPresenter>();
     _presenterSettingsTask      = A.Fake <IPresentationSettingsTask>();
     _treeNodeFactory            = A.Fake <ITreeNodeFactory>();
     _groupRepository            = A.Fake <IGroupRepository>();
     _userSettings               = A.Fake <IUserSettings>();
     _treeNodeContextMenuFactory = A.Fake <ITreeNodeContextMenuFactory>();
     _organism                   = A.Fake <Organism>();
     _allParameters              = new List <IParameter>();
     _parameter                  = A.Fake <IParameter>();
     A.CallTo(() => _parameter.Rules).Returns(new BusinessRuleSet());
     _parameterDTO = A.Fake <ParameterDTO>();
     A.CallTo(() => _parameterDTO.Parameter).Returns(_parameter);
     A.CallTo(() => _organism.GetAllChildren(A <Func <IParameter, bool> > .Ignored)).Returns(_allParameters);
     _containerNode = A.Fake <ITreeNode>();
     A.CallTo(() => _containerNodeMapper.MapFrom(_organism)).Returns(_containerNode);
     A.CallTo(() => _containerNode.Children).Returns(new List <ITreeNode>());
     _groupAllNode         = A.Fake <ITreeNode <IGroup> >();
     _groupFavoritesNode   = A.Fake <ITreeNode <IGroup> >();
     _groupUserDefinedNode = A.Fake <ITreeNode <IGroup> >();
     A.CallTo(() => _treeNodeFactory.CreateGroupAll()).Returns(_groupAllNode);
     A.CallTo(() => _treeNodeFactory.CreateGroupFavorites()).Returns(_groupFavoritesNode);
     A.CallTo(() => _treeNodeFactory.CreateGroupUserDefined()).Returns(_groupUserDefinedNode);
     A.CallTo(() => _noItemInSelectionPresenter.BaseView).Returns(A.Fake <IView>());
 }
Exemplo n.º 3
0
 public override void GlobalContext()
 {
     base.GlobalContext();
     _compound   = DomainFactoryForSpecs.CreateStandardCompound();
     _individual = DomainFactoryForSpecs.CreateStandardIndividual();
     _protocol   = DomainFactoryForSpecs.CreateStandardIVBolusProtocol();
     _compoundProcessRepository = IoC.Resolve <ICompoundProcessRepository>();
     _parameterGroupTask        = IoC.Resolve <IParameterGroupTask>();
     _cloneManager = IoC.Resolve <ICloneManager>();
 }
 protected override void Context()
 {
     _view = A.Fake <IPopulationParameterGroupsView>();
     _parameterGroupTask           = A.Fake <IParameterGroupTask>();
     _groupNodeCreator             = A.Fake <IPopulationGroupNodeCreator>();
     _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
     _hierarchyNodeCreator         = A.Fake <IPopulationHierarchyNodeCreator>();
     _allParameters = new List <IParameter>();
     sut            = new PopulationParameterGroupsPresenter(_view, _parameterGroupTask, _groupNodeCreator, _hierarchyNodeCreator);
 }
Exemplo n.º 5
0
      protected override void Context()
      {
         _treeNodeFactory= A.Fake<ITreeNodeFactory>();
         _parameterGroupTask= A.Fake<IParameterGroupTask>();
         
         sut = new DynamicGroupExpander(_parameterGroupTask, _treeNodeFactory);

         _parameters = new List<IParameter>();
         A.CallTo(_parameterGroupTask).WithReturnType<IEnumerable<IParameter>>().Returns(_parameters);
      }
 public PopulationGroupNodeCreator(IParameterGroupNodeCreator parameterGroupNodeCreator, IParameterGroupTask parameterGroupTask,
                                   ITreeNodeFactory treeNodeFactory, IFullPathDisplayResolver fullPathDisplayResolver,
                                   IToolTipPartCreator toolTipPartCreator, IPathToPathElementsMapper pathElementsMapper)
 {
     _parameterGroupNodeCreator = parameterGroupNodeCreator;
     _parameterGroupTask        = parameterGroupTask;
     _treeNodeFactory           = treeNodeFactory;
     _fullPathDisplayResolver   = fullPathDisplayResolver;
     _toolTipPartCreator        = toolTipPartCreator;
     _pathElementsMapper        = pathElementsMapper;
 }
Exemplo n.º 7
0
 protected CompoundAdvancedParameterGroupPresenter(TView view, IRepresentationInfoRepository representationInfoRepository,
                                                   IMultiParameterEditPresenter parameterEditPresenter, IParameterGroupTask parameterGroupTask,
                                                   string groupName)
     : base(view)
 {
     _parameterEditPresenter = parameterEditPresenter;
     _parameterGroupTask     = parameterGroupTask;
     _parameterEditPresenter.IsSimpleEditor = true;
     _groupName   = groupName;
     View.Caption = representationInfoRepository.DisplayNameFor(RepresentationObjectType.GROUP, _groupName);
     View.SetParameterView(_parameterEditPresenter.View);
 }
Exemplo n.º 8
0
 public CompoundFactory(
     IObjectBaseFactory objectBaseFactory,
     IParameterContainerTask parameterContainerTask,
     IParameterAlternativeFactory parameterAlternativeFactory,
     IParameterGroupTask parameterGroupTask,
     ICompoundCalculationMethodCategoryRepository compoundCalculationMethodCategoryRepository)
 {
     _objectBaseFactory           = objectBaseFactory;
     _parameterContainerTask      = parameterContainerTask;
     _parameterAlternativeFactory = parameterAlternativeFactory;
     _parameterGroupTask          = parameterGroupTask;
     _compoundCalculationMethodCategoryRepository = compoundCalculationMethodCategoryRepository;
 }
Exemplo n.º 9
0
        protected override void Context()
        {
            _parameterGroupTask           = A.Fake <IParameterGroupTask>();
            _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
            _treeNodeCreator         = A.Fake <IParameterGroupNodeCreator>();
            _fullPathDisplayResolver = A.Fake <IFullPathDisplayResolver>();
            _toolTipPartCreator      = A.Fake <IToolTipPartCreator>();
            _treeNodeFactory         = new TreeNodeFactoryForSpecs();

            A.CallTo(() => _representationInfoRepository.InfoFor(A <IObjectBase> ._))
            .ReturnsLazily(x => new RepresentationInfo {
                DisplayName = x.GetArgument <IObjectBase>(0).Name
            });

            A.CallTo(() => _representationInfoRepository.DisplayNameFor(A <IObjectBase> ._))
            .ReturnsLazily(x => x.GetArgument <IObjectBase>(0).Name);

            _pathElementsMapper = new PKSimPathToPathElementsMapper(_representationInfoRepository, new EntityPathResolverForSpecs());

            sut = new PopulationGroupNodeCreator(_treeNodeCreator, _parameterGroupTask, _treeNodeFactory, _fullPathDisplayResolver, _toolTipPartCreator, _pathElementsMapper);

            _para1         = new PKSimParameter().WithId("P1").WithName("P1");
            _para2         = new PKSimParameter().WithId("P2").WithName("P2");
            _allParameters = new List <IParameter> {
                _para1, _para2
            };
            _rootGroup = new Group {
                Name = "group1"
            };
            _subGroup = new Group {
                Name = "subGroup"
            };
            _subGroupNode = new GroupNode(_subGroup);
            _rootNode     = new GroupNode(_rootGroup);
            _rootNode.AddChild(_subGroupNode);
            A.CallTo(() => _treeNodeCreator.MapForPopulationFrom(_rootGroup, _allParameters)).Returns(_rootNode);
            A.CallTo(() => _parameterGroupTask.ParametersIn(_subGroup, _allParameters)).Returns(_allParameters);
            A.CallTo(() => _parameterGroupTask.ParametersIn(_rootGroup, _allParameters)).Returns(new List <IParameter>());
            _liver  = new Container().WithName("Liver").WithId("Liver");
            _kidney = new Container().WithName("Kidney").WithId("Kidney");
        }
Exemplo n.º 10
0
 public ParameterGroupsPresenter(IParameterGroupsView view, IParameterGroupTask parameterGroupTask,
                                 IParameterGroupNodeCreator groupNodeCreator,
                                 IParameterContainerToTreeNodeMapper containerNodeMapper,
                                 INodeToCustomableParametersPresenterMapper parametersPresenterMapper,
                                 INoItemInSelectionPresenter noItemInSelectionPresenter,
                                 ITreeNodeFactory treeNodeFactory, IGroupRepository groupRepository, IUserSettings userSettings,
                                 IPresentationSettingsTask presentationSettingsTask, ITreeNodeContextMenuFactory treeNodeContextMenuFactory)
     : base(view)
 {
     _parameterGroupTask         = parameterGroupTask;
     _groupNodeCreator           = groupNodeCreator;
     _containerNodeMapper        = containerNodeMapper;
     _parametersPresenterMapper  = parametersPresenterMapper;
     _noItemInSelectionPresenter = noItemInSelectionPresenter;
     _groupRepository            = groupRepository;
     _userSettings               = userSettings;
     _presentationSettingsTask   = presentationSettingsTask;
     _treeNodeContextMenuFactory = treeNodeContextMenuFactory;
     _parameterPresenterCache    = new Cache <ITreeNode, ICustomParametersPresenter>();
     _nodesCache   = new Cache <ParameterGroupingMode, IEnumerable <ITreeNode> >();
     _allGroupNode = treeNodeFactory.CreateGroupAll();
     _favoriteNode = treeNodeFactory.CreateGroupFavorites();
 }
Exemplo n.º 11
0
 public TwoPoreGroupPresenter(ICompoundAdvancedParameterGroupView view, IRepresentationInfoRepository representationInfoRepository, IMultiParameterEditPresenter parameterEditPresenter, IParameterGroupTask parameterGroupTask) :
     base(view, representationInfoRepository, parameterEditPresenter, parameterGroupTask, CoreConstants.Groups.COMPOUND_TWO_PORE)
 {
     view.Hint = PKSimConstants.UI.CompoundTwoPoreParametersNote;
 }
Exemplo n.º 12
0
 public DynamicGroupExpander(IParameterGroupTask parameterGroupTask, ITreeNodeFactory treeNodeFactory)
 {
     _parameterGroupTask = parameterGroupTask;
     _treeNodeFactory    = treeNodeFactory;
 }
 public ParticleDissolutionGroupPresenter(ICompoundAdvancedParameterGroupView view, IRepresentationInfoRepository representationInfoRepository,
                                          IMultiParameterEditPresenter parameterEditPresenter, IParameterGroupTask parameterGroupTask)
     : base(view, representationInfoRepository, parameterEditPresenter, parameterGroupTask, CoreConstants.Groups.COMPOUND_DISSOLUTION)
 {
     view.Hint = PKSimConstants.UI.CompoundParticleDissolutionParametersNote;
 }