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>());
 }
      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;
 }
示例#4
0
 protected ExplorerPresenter(TView view, ITreeNodeFactory treeNodeFactory, ITreeNodeContextMenuFactory treeNodeContextMenuFactory,
                             IMultipleTreeNodeContextMenuFactory multipleTreeNodeContextMenuFactory,
                             IBuildingBlockIconRetriever buildingBlockIconRetriever, IRegionResolver regionResolver, IBuildingBlockTask buildingBlockTask, RegionName regionName,
                             IProjectRetriever projectRetriever, IClassificationPresenter classificationPresenter, IToolTipPartCreator toolTipPartCreator) :
     base(view, regionResolver, classificationPresenter, toolTipPartCreator, regionName, projectRetriever)
 {
     _treeNodeFactory                    = treeNodeFactory;
     _treeNodeContextMenuFactory         = treeNodeContextMenuFactory;
     _multipleTreeNodeContextMenuFactory = multipleTreeNodeContextMenuFactory;
     _buildingBlockIconRetriever         = buildingBlockIconRetriever;
     _buildingBlockTask                  = buildingBlockTask;
 }
示例#5
0
 protected override void Context()
 {
     _view = A.Fake <IBuildingBlockFromTemplateView>();
     _templateTaskQuery     = A.Fake <ITemplateTaskQuery>();
     _objectTypeResolver    = A.Fake <IObjectTypeResolver>();
     _treeNodeFactory       = A.Fake <ITreeNodeFactory>();
     _contextMenuFactory    = A.Fake <ITreeNodeContextMenuFactory>();
     _applicationController = A.Fake <IApplicationController>();
     _dialogCreator         = A.Fake <IDialogCreator>();
     _startOptions          = A.Fake <IStartOptions>();
     sut = new TemplatePresenter(_view, _templateTaskQuery, _objectTypeResolver, _treeNodeFactory, _contextMenuFactory, _applicationController, _dialogCreator, _startOptions);
 }
示例#6
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");
        }
示例#7
0
 public ParameterGroupsPresenter(IParameterGroupsView view, IParameterGroupTask parameterGroupTask,
                                 IParameterGroupNodeCreator groupNodeCreator,
                                 IParameterContainerToTreeNodeMapper containerNodeMapper,
                                 INodeToCustomizableParametersPresenterMapper 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();
     _userDefinedNode = treeNodeFactory.CreateGroupUserDefined();
 }
示例#8
0
 public PopulationHierarchyNodeCreator(ITreeNodeFactory treeNodeFactory, IRepresentationInfoRepository representationInfoRepository)
 {
     _treeNodeFactory = treeNodeFactory;
     _representationInfoRepository = representationInfoRepository;
 }
示例#9
0
 protected override void Context()
 {
     _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
     _treeNodeFactory = new TreeNodeFactoryForSpecs();
     sut = new PopulationHierarchyNodeCreator(_treeNodeFactory, _representationInfoRepository);
 }
 public ParameterGroupToTreeNodeMapper(ITreeNodeFactory treeNodeFactory)
 {
     _treeNodeFactory = treeNodeFactory;
 }