public void BlockingActions__ReturnsBlockingActions() { var stubBlockingActions = new Mock <IBlockingActionsPresenter>(); var test = new ActionTreeNodePresenter(AnAction.BlockedBy(AnAction).Build(), stubBlockingActions.Object); Assert.Same(stubBlockingActions.Object, test.BlockingActions); }
public void Actions_WhenWorkspaceContainsAnActionThatIsBlockedButNotBlocking_ContainsAction() { IAction unblockedAction = AnAction.Build(); IAction blockedAction = AnAction.BlockedBy(unblockedAction).Build(); var test = new ProjectsFilter(AWorkspace.With(blockedAction). With(unblockedAction).Build()); Assert.Contains(blockedAction, test.Actions); Assert.Equal(1, test.Actions.Count); }
public void Presenters_WhenActionHasABlockingAction_ContainsPresenterForBlockingAction() { IAction blockingAction = AnAction.Build(); var stubPresenter = new Mock <IActionPresenter>(); var test = new BlockingActionsPresenter(AnAction.BlockedBy(blockingAction).Build(), delegate(IAction action) { Assert.Same(blockingAction, action); return(stubPresenter.Object); }); test.Initialize(); Assert.Contains(stubPresenter.Object, test.Screens); }