public void CloneButtonIsOnlyHiddenOnce() { var view = Mocks.StrictMock<CloneView>(); view.Expect(v => v.ShowCloneButton()).Repeat.Once(); view.Expect(v => v.HideCloneButton()).Repeat.Once(); view.RepositoryToClone = null; LastCall.PropertyBehavior(); view.DestinationFolder = null; LastCall.PropertyBehavior(); Mocks.ReplayAll(); view.RepositoryToClone = "some value"; view.DestinationFolder = "more value"; var presenter = new ClonePresenter(view); presenter.DestionFolderTextChanged(); Assert.That(presenter.IsCloneButtonShown, Is.True); view.RepositoryToClone = null; view.DestinationFolder = null; presenter.DestionFolderTextChanged(); Assert.That(presenter.IsCloneButtonShown, Is.False); view.RepositoryToClone = null; view.DestinationFolder = null; presenter.DestionFolderTextChanged(); Assert.That(presenter.IsCloneButtonShown, Is.False); }
public void WhenRepositoryIsNotPopulatedTheCloneButtonIsNotShown() { CloneView view = SetUpTestForHideCloneButton(); var presenter = new ClonePresenter(view); view.RepositoryToClone = "value"; view.DestinationFolder = "some value"; presenter.DestionFolderTextChanged(); view.RepositoryToClone = null; view.DestinationFolder = "some value"; presenter.DestionFolderTextChanged(); Assert.That(presenter.IsCloneButtonShown, Is.False); }
public void WhenRepositoryAndDestinaitonArePopulatedCloneButtonIsShown() { CloneView view = SetUpTestForDisplayCloneButton(); view.RepositoryToClone = "some value"; view.DestinationFolder = "some value, can be same of different"; var presenter = new ClonePresenter(view); presenter.DestionFolderTextChanged(); Assert.That(presenter.IsCloneButtonShown, Is.True); }
public void WhenCloneButtonIsVisibleItNotDisplayedAgain() { var view = Mocks.StrictMock<CloneView>(); view.Expect(v => v.ShowCloneButton()).Repeat.Once(); view.SetPropertyAsBehavior(v => v.RepositoryToClone); view.SetPropertyAsBehavior(v => v.DestinationFolder); Mocks.ReplayAll(); view.RepositoryToClone = "some value"; view.DestinationFolder = "more value"; var presenter = new ClonePresenter(view); presenter.DestionFolderTextChanged(); Assert.That(presenter.IsCloneButtonShown, Is.True); view.RepositoryToClone = "changes value"; view.DestinationFolder = "other changes value"; presenter.DestionFolderTextChanged(); Assert.That(presenter.IsCloneButtonShown, Is.True); }