private void VerifyGitRepositoryName(string gitUrl) { string expectedDestinationFolder = string.Format("{0}\\{1}", DestinationLocation, "FatCatGit"); CloneView cloneView = SetUpClonePresenterTestWithRepositry(gitUrl, expectedDestinationFolder); var presenter = new ClonePresenter(cloneView); presenter.SetDestinationFolder(DestinationLocation); Assert.That(cloneView.DestinationFolder, Is.EqualTo(expectedDestinationFolder)); }
public void WhenRepositoryIsLocalNameIsNotAutomaticlyPutInDestinationFolder() { CloneView cloneView = SetUpClonePresenterTestWithRepositry(TestRepository, DestinationLocation); var presenter = new ClonePresenter(cloneView); presenter.SetDestinationFolder(DestinationLocation); Assert.That(cloneView.DestinationFolder, Is.EqualTo(DestinationLocation)); }
public void SpecificyDestionationFolderWillUseRepositoryNameAsSubFolderWhenRepoUnderParentFolder() { var expectedDestinationFolder = string.Format("{0}\\{1}", DestinationLocation, "SubFolderTest"); var cloneView = SetUpClonePresenterTestWithRepositry(@"[email protected]:DavidBasarab/SubFolderTest.git", expectedDestinationFolder); var presenter = new ClonePresenter(cloneView); presenter.SetDestinationFolder(DestinationLocation); Assert.That(cloneView.DestinationFolder, Is.EqualTo(expectedDestinationFolder)); }
public void IfDirectoryEndsInRepoNameDoNotAdd() { string expectedDestinationFolder = string.Format("{0}\\{1}\\", DestinationLocation, "SomeTestRepository"); CloneView cloneView = SetUpClonePresenterTestWithRepositry(TestRepository, expectedDestinationFolder); var presenter = new ClonePresenter(cloneView); presenter.SetDestinationFolder(expectedDestinationFolder); Assert.That(cloneView.DestinationFolder, Is.EqualTo(expectedDestinationFolder)); }
public void IfDestinationFolderBlankItIsNotSet() { var cloneView = Mocks.DynamicMock<CloneView>(); cloneView.Expect(v => v.RepositoryToClone).IgnoreArguments().Repeat.Never(); cloneView.DestinationFolder = null; LastCall.PropertyBehavior(); LastCall.IgnoreArguments(); LastCall.Repeat.Never(); Mocks.ReplayAll(); var presenter = new ClonePresenter(cloneView); presenter.SetDestinationFolder(null); Assert.That(cloneView.DestinationFolder, Is.Null); }
public void DestinationFolderWillNotAddExtraSlashAtEndOfTheFolder() { var expectedDestinationFolder = string.Format("{0}\\{1}", DestinationLocation, "SubFolderTest"); var cloneView = SetUpClonePresenterTestWithRepositry(@"[email protected]:DavidBasarab/SubFolderTest.git", expectedDestinationFolder); var presenter = new ClonePresenter(cloneView); presenter.SetDestinationFolder(DestinationLocation); Assert.That(cloneView.DestinationFolder, Is.EqualTo(expectedDestinationFolder)); }