public void CanAdd_WhenTitleIsNotEmpty_IsTrue() { _fakeAction = AnAction.Called("This action has a title").Mock(); InputPresenter test = BuildDefaultInputViewPresenter(); Assert.True(test.CanAdd()); }
public void DisplayName__ReturnsActionTitle() { const string titleOfTheAction = "Title of the action"; var test = new ProcessActionPresenter(AnAction.Called(titleOfTheAction).Build(), x => new[] { _fakeProcessor.Object }); Assert.Equal(titleOfTheAction, test.DisplayName); }
public void CanAdd_WhenTitleIsEmpty_IsFalse() { _fakeAction = AnAction.Called(string.Empty).Mock(); InputPresenter test = BuildDefaultInputViewPresenter(); Assert.False(test.CanAdd()); }
public void DisplayName_WhenActionTitleChanges_RaisesPropertyChanged() { const string titleOfTheAction = "Title of the action"; Mock <IAction> stubAction = AnAction.Called(titleOfTheAction).Mock(); var test = new ProcessActionPresenter(stubAction.Object, x => new[] { _fakeProcessor.Object }); test.AssertThatChangeNotificationIsRaisedBy(x => x.DisplayName). When(() => stubAction.Raise(x => x.PropertyChanged += null, new PropertyChangedEventArgs("Title"))); }