コード例 #1
0
 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>());
 }
コード例 #2
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();
 }