8000 Allow cloning of repositories into empty directories by YuPeiHenry · Pull Request #2316 · github/VisualStudio · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Allow cloning of repositories into empty directories #2316

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ammend some tests in RepositoryCloneServiceTests to not use data.
  • Loading branch information
YuPeiHenry committed Apr 4, 2019
commit 37b05a7fcc129a029e4931bbf9785615ea862ae9
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ await usageTracker.Received(numberOfCalls).IncrementCounter(
((MemberExpression)x.Body).Member.Name == counterName));
}

[TestCase("https://github.com/failing/url", @"c:\dev\bar")]
public async Task CleansDirectoryOnCloneFailed(string cloneUrl, string clonePath)
[Test]
public async Task CleansDirectoryOnCloneFailed()
{
var cloneUrl = "https://github.com/failing/url";
var clonePath = @"c:\dev\bar";
var operatingSystem = Substitute.For<IOperatingSystem>();
var vsGitServices = Substitute.For<IVSGitServices>();
vsGitServices.Clone(cloneUrl, clonePath, true).Returns(x => { throw new Exception(); });
Expand All @@ -136,9 +138,11 @@ public async Task CleansDirectoryOnCloneFailed(string cloneUrl, string clonePath
await vsGitServices.Received().Clone(cloneUrl, clonePath, true);
}

[TestCase("https://github.com/foo/bar", @"c:\empty\directory")]
public async Task CloneIntoEmptyDirectory(string cloneUrl, string clonePath)
[Test]
public async Task CloneIntoEmptyDirectory()
{
var cloneUrl = "https://github.com/foo/bar";
var clonePath = @"c:\empty\directory";
var operatingSystem = Substitute.For<IOperatingSystem>();
operatingSystem.Directory.DirectoryExists(clonePath).Returns(true);
operatingSystem.Directory.IsEmpty(clonePath).Returns(true);
Expand Down
0