protected override void Context() { base.Context(); CreateSutForSettings(ParameterGroupingModeId.Advanced); _validPresenter = A.Fake <ICustomParametersPresenter>(); _visibleParameter = A.Fake <IParameter>(); _visibleParameter.Visible = true; var hiddenParameter = A.Fake <IParameter>(); hiddenParameter.Visible = false; _allParameters.Add(_visibleParameter); _allParameters.Add(hiddenParameter); A.CallTo(() => _parameterPresenterMapper.MapFrom(_groupUserDefinedNode)).Returns(_validPresenter); A.CallTo(() => _validPresenter.Edit(A <IEnumerable <IParameter> > .Ignored)).Invokes(x => _parameters = x.GetArgument <IEnumerable <IParameter> >(0)); sut.InitializeWith(_organism, _allParameters); sut.ParameterGroupingMode = ParameterGroupingModes.Advanced; }
public void ActivateNode(ITreeNode node) { if (node == null) { return; } var alreadyLoaded = _parameterPresenterCache.Contains(node); _activePresenter = presenterFor(node); _settings.SelectedNodeId = node.Id; //this needs to be done before editing the parameters _view.ActivateView(_activePresenter.BaseView); if (alreadyLoaded && !_activePresenter.AlwaysRefresh) { return; } _activePresenter.Edit(allVisibleParametersIn(node)); }
public void ActivateNode(ITreeNode node) { if (node == null) { return; } _view.GroupCaption = node.FullPath(PKSimConstants.UI.DisplayPathSeparator); bool alreadyLoaded = _parameterPresenterCache.Contains(node); _activePresenter = presenterFor(node); _settings.SelectedNodeId = node.Id; //this needs to be done before editing the parameters _view.ActivateView(_activePresenter.BaseView); if (alreadyLoaded) { return; } _activePresenter.Edit(allVisibleParametersIn(node)); }
protected override void Context() { base.Context(); CreateSutForSettings(ParameterGroupingModeId.Advanced); _group = A.Fake <IGroup>(); _validPresenter = A.Fake <ICustomParametersPresenter>(); _visibleParameter = A.Fake <IParameter>(); _visibleParameter.Visible = true; var hiddenParameter = A.Fake <IParameter>(); hiddenParameter.Visible = false; _allParameters.Add(_visibleParameter); _allParameters.Add(hiddenParameter); A.CallTo(() => _visibleParameter.GroupName).Returns("toto"); A.CallTo(() => hiddenParameter.GroupName).Returns("toto"); A.CallTo(() => _groupRepository.GroupByName(_visibleParameter.GroupName)).Returns(_group); A.CallTo(() => _parameterPresenterMapper.MapFrom(_groupAllNode)).Returns(_validPresenter); A.CallTo(() => _parameterGroupTask.TopGroupsUsedBy(A <IEnumerable <IParameter> > .Ignored)).Returns(new[] { _group }); A.CallTo(() => _parameterGroupTask.ParametersIn(_group, _allParameters)).Returns(new[] { _visibleParameter, hiddenParameter }); A.CallTo(() => _validPresenter.Edit(A <IEnumerable <IParameter> > .Ignored)).Invokes(x => _parameters = x.GetArgument <IEnumerable <IParameter> >(0)); sut.InitializeWith(_organism, _allParameters); sut.ParameterGroupingMode = ParameterGroupingModes.Advanced; }
public void should_edit_the_parameters_again() { A.CallTo(() => _alwaysRefreshPresenter.Edit(A <IEnumerable <IParameter> > ._)).MustHaveHappened(Repeated.Exactly.Twice); }