public void CloneWillThrowAnExceptionIfRepoToCloneIsNotPopulated()
        {
            var cloneView = Mocks.StrictMock <CloneView>();

            cloneView.SetPropertyAsBehavior(v => v.RepositoryToClone);
            cloneView.SetPropertyAsBehavior(v => v.DestinationFolder);

            var clone = Mocks.StrictMock <Clone>();

            clone.SetPropertyAsBehavior(v => v.RepositoryToClone);
            clone.SetPropertyAsBehavior(v => v.Destination);

            clone.Expect(v => v.Run()).Repeat.Never();

            Mocks.ReplayAll();

            const string destinationFolder = @"C:\NewClone\Location";

            cloneView.RepositoryToClone = null;
            cloneView.DestinationFolder = destinationFolder;

            var presenter = new ClonePresenter(cloneView)
            {
                Clone = clone
            };

            presenter.PerformClone();
        }
        public void CloneWillCloneTheRepositoryToTheDestination()
        {
            var cloneView = Mocks.StrictMock <CloneView>();

            cloneView.SetPropertyAsBehavior(v => v.RepositoryToClone);
            cloneView.SetPropertyAsBehavior(v => v.DestinationFolder);

            var clone = Mocks.StrictMock <Clone>();

            clone.SetPropertyAsBehavior(v => v.RepositoryToClone);
            clone.SetPropertyAsBehavior(v => v.Destination);
            clone.SetPropertyAsBehavior(v => v.ProjectLocation);

            var result = new TestAsyncResults
            {
                AsyncState = new FakeOutput
                {
                    Output = "Clone completed successfully"
                }
            };

            clone.Expect(v => v.Run()).Return(result);

            Mocks.ReplayAll();

            const string repoToClone       = @"C:\UnitTestRepo\ToClone";
            const string destinationFolder = @"C:\NewClone\Location";

            cloneView.RepositoryToClone = repoToClone;
            cloneView.DestinationFolder = destinationFolder;

            var presenter = new ClonePresenter(cloneView)
            {
                Clone = clone
            };

            bool   eventTriggered = false;
            string output         = string.Empty;

            Action <Output> cloneComplete = o =>
            {
                eventTriggered = true;
                output         = o.Output;
            };

            presenter.CloneComplete += cloneComplete;

            presenter.PerformClone();

            Assert.That(clone.RepositoryToClone, Is.EqualTo(repoToClone));
            Assert.That(clone.Destination, Is.EqualTo(destinationFolder));
            Assert.That(eventTriggered);
            Assert.That(output, Is.EqualTo("Clone completed successfully"));
            Assert.That(clone.ProjectLocation, Is.Null);
        }