diff options
author | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2015-09-12 19:43:12 +0300 |
---|---|---|
committer | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2015-09-12 19:43:31 +0300 |
commit | d9cae847e9821fba45c7c0afe73f94be93c8b411 (patch) | |
tree | 2795b6ddeab11a8b3173b63c2c639c198c280e8c /main/src/addins/VersionControl | |
parent | 9cb839ed1ca51e50ff46e73b91b5e71015acd15f (diff) |
[VCS] Remodel the test suite repo construction
This makes it similar to how we do real checkouts in the IDE.
Diffstat (limited to 'main/src/addins/VersionControl')
4 files changed, 21 insertions, 2 deletions
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs index a3d92cdaf7..72243ad5f8 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs @@ -392,6 +392,11 @@ index 0000000..009b64b return new GitRepository (VersionControlService.GetVersionControlSystems ().First (id => id.Name == "Git"), path, url); } + protected override Repository GetRepo () + { + return new GitRepository (); + } + // This test is for a memory usage improvement on status. [Test] public void TestSameGitRevision () diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs index bf8a61fa1c..46b64db071 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs @@ -654,8 +654,11 @@ namespace MonoDevelop.VersionControl.Tests protected void Checkout (string path, string url) { - Repository _repo = GetRepo (path, url); - _repo.Checkout (path, true, new NullProgressMonitor ()); + var mockRepo = (UrlBasedRepository)GetRepo (); + mockRepo.Url = url; + mockRepo.Checkout (path, true, new NullProgressMonitor ()); + + var _repo = GetRepo (path, url); if (Repo == null) Repo = _repo; else @@ -714,6 +717,7 @@ namespace MonoDevelop.VersionControl.Tests AddedItems.Add (added); } + protected abstract Repository GetRepo (); protected abstract Repository GetRepo (string path, string url); protected static void DeleteDirectory (string path) diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs index ddbc5124ab..d46fe7313a 100644 --- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs +++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs @@ -137,6 +137,11 @@ namespace VersionControl.Subversion.Unix.Tests { return new SubversionRepository (new SvnClient (), url, path); } + + protected override Repository GetRepo () + { + return new SubversionRepository (new SvnClient (), string.Empty, FilePath.Empty); + } } } diff --git a/main/src/addins/VersionControl/Subversion.Win32.Tests/RepositoryTests.cs b/main/src/addins/VersionControl/Subversion.Win32.Tests/RepositoryTests.cs index 3d93fc42cf..03fa2e6b7b 100644 --- a/main/src/addins/VersionControl/Subversion.Win32.Tests/RepositoryTests.cs +++ b/main/src/addins/VersionControl/Subversion.Win32.Tests/RepositoryTests.cs @@ -131,6 +131,11 @@ namespace MonoDevelop.VersionControl.Subversion.Tests {
return new SubversionRepository (new SvnSharpClient (), url, path);
}
+
+ protected override Repository GetRepo ()
+ {
+ return new SubversionRepository (new SvnSharpClient (), string.Empty, FilePath.Empty);
+ }
}
}
|