public void WhenTextIsRemovedToRepositoryHideDisplayIsCalled()
        {
            var view = Mocks.DynamicMock<CloneView>();

            view.Expect(v => v.HideDestinationFolder());

            view.RepositoryToClone = "ve";
            LastCall.PropertyBehavior();

            Mocks.ReplayAll();

            view.RepositoryToClone = "some early data";

            var presenter = new ClonePresenter(view);

            presenter.RepositoryToCloneChanged();

            view.RepositoryToClone = null;

            presenter.RepositoryToCloneChanged();

            Assert.That(presenter.DestinationFolderDisplayed, Is.False);
        }
        public void WhenTextIsAddedToRepositoryDisplayDestionationIsCalled()
        {
            var view = Mocks.DynamicMock<CloneView>();

            view.Expect(v => v.DisplayDestinationFolder());

            view.RepositoryToClone = "ve";
            LastCall.PropertyBehavior();

            Mocks.ReplayAll();

            view.RepositoryToClone = "somedata";

            var presenter = new ClonePresenter(view);

            presenter.RepositoryToCloneChanged();

            Assert.That(presenter.DestinationFolderDisplayed, Is.True);
        }
        public void SecondTimeRepositoryToCloneChangedAndValidTextNoChangeWithDestionationFolderOccuers()
        {
            var view = Mocks.StrictMock<CloneView>();

            view.Expect(v => v.DisplayDestinationFolder()).Repeat.Once();

            view.RepositoryToClone = "ve";
            LastCall.PropertyBehavior();

            Mocks.ReplayAll();

            view.RepositoryToClone = "somedata";

            var presenter = new ClonePresenter(view);

            presenter.RepositoryToCloneChanged();

            Assert.That(presenter.DestinationFolderDisplayed, Is.True);

            view.RepositoryToClone = "new data";

            presenter.RepositoryToCloneChanged();

            Assert.That(presenter.DestinationFolderDisplayed, Is.True);
        }
        public void WhenRespitoryToChangeIsNullAndAChangeEventWillNotDisplayDestination()
        {
            var view = Mocks.StrictMock<CloneView>();

            view.Expect(v => v.HideDestinationFolder()).Repeat.Never();

            view.RepositoryToClone = "ve";
            LastCall.PropertyBehavior();

            Mocks.ReplayAll();

            view.RepositoryToClone = null;

            var presenter = new ClonePresenter(view);

            presenter.RepositoryToCloneChanged();

            Assert.That(presenter.DestinationFolderDisplayed, Is.False);
        }
        public void HideDestionationFolderWillNotBeCalledTwiceWhenNoChange()
        {
            var view = Mocks.StrictMock<CloneView>();

            view.Expect(v => v.HideDestinationFolder()).Repeat.Once();
            view.Expect(v => v.DisplayDestinationFolder()).Repeat.Once();

            view.RepositoryToClone = "does_not_matter";
            LastCall.PropertyBehavior();

            Mocks.ReplayAll();

            view.RepositoryToClone = "some data to get test set up";

            var presenter = new ClonePresenter(view);

            presenter.RepositoryToCloneChanged();

            Assert.That(presenter.DestinationFolderDisplayed, Is.True);

            view.RepositoryToClone = null;

            presenter.RepositoryToCloneChanged();

            Assert.That(presenter.DestinationFolderDisplayed, Is.False);

            view.RepositoryToClone = null;

            presenter.RepositoryToCloneChanged();

            Assert.That(presenter.DestinationFolderDisplayed, Is.False);
        }