diff options
author | Therzok <teromario@yahoo.com> | 2013-07-19 18:12:16 +0400 |
---|---|---|
committer | Therzok <teromario@yahoo.com> | 2013-07-19 18:12:16 +0400 |
commit | 0654a0044a4b1e0e82dc6d6f30d068e39a32ebca (patch) | |
tree | 81711259a273954f1c8b5ac41cb3760cfb0c25e8 /extras | |
parent | 0a39a226e2ac11941a6a506ed74039a182863b39 (diff) |
[Version Control] Unit Tests - fixups. ;D
Diffstat (limited to 'extras')
4 files changed, 12 insertions, 36 deletions
diff --git a/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/BaseRepositoryTests.cs b/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/BaseRepositoryTests.cs index ac2375aa84..5ec0100741 100644 --- a/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/BaseRepositoryTests.cs +++ b/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/BaseRepositoryTests.cs @@ -30,7 +30,6 @@ using System; using MonoDevelop.Core; using MonoDevelop.Core.ProgressMonitoring; using MonoDevelop.VersionControl; -using MonoDevelop.VersionControl.Git; namespace MonoDevelop.VersionControl.Tests { @@ -63,14 +62,12 @@ namespace MonoDevelop.VersionControl.Tests [Test] public virtual void FileIsAdded () { - if (DOT_DIR == ".svn") - Assert.Ignore ("Problem with version info cache for Svn."); - FilePath added = rootCheckout + "testfile"; File.Create (added).Close (); repo.Add (added, false, new NullProgressMonitor ()); VersionInfo vi = repo.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache); + if (DOT_DIR == ".git") Assert.AreEqual (VersionStatus.Versioned, (VersionStatus.Versioned & vi.Status)); @@ -82,10 +79,6 @@ namespace MonoDevelop.VersionControl.Tests [Test] public virtual void FileIsCommitted () { - if (DOT_DIR == ".svn") - Assert.Ignore ("Problem with version info cache for Svn."); - - GitRepository repo3; FilePath added = rootCheckout + "testfile"; File.Create (added).Close (); @@ -95,13 +88,14 @@ namespace MonoDevelop.VersionControl.Tests changes.GlobalComment = "test"; repo.Commit (changes, new NullProgressMonitor ()); - if (DOT_DIR == ".git") { - repo3 = (GitRepository)repo; - repo3.Push (new NullProgressMonitor (), repo3.GetCurrentRemote (), repo3.GetCurrentBranch ()); - } + PostCommit (repo); VersionInfo vi = repo.GetVersionInfo (added, VersionInfoQueryFlags.IncludeRemoteStatus); - Assert.AreEqual (VersionStatus.Versioned, (VersionStatus.Versioned & vi.RemoteStatus)); + Assert.AreEqual (VersionStatus.Versioned, (VersionStatus.Versioned & vi.Status)); + } + + protected virtual void PostCommit (Repository repo) + { } [Test] @@ -111,11 +105,6 @@ namespace MonoDevelop.VersionControl.Tests if (DOT_DIR == ".git") Assert.Ignore ("Checkout command locks a pack file for Git."); - if (DOT_DIR == ".svn") - Assert.Ignore ("Problem with version info cache for Svn."); - - GitRepository repo3; - string added = rootCheckout + "testfile"; File.Create (added).Close (); repo.Add (added, false, new NullProgressMonitor ()); @@ -124,11 +113,7 @@ namespace MonoDevelop.VersionControl.Tests changes.GlobalComment = "test"; repo.Commit (changes, new NullProgressMonitor ()); - // We need to push on Git. - if (DOT_DIR == ".git") { - repo3 = (GitRepository)repo; - repo3.Push (new NullProgressMonitor (), repo3.GetCurrentRemote (), repo3.GetCurrentBranch ()); - } + PostCommit (repo); // Checkout a second repository. FilePath second = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar); @@ -142,10 +127,7 @@ namespace MonoDevelop.VersionControl.Tests changes.GlobalComment = "test2"; repo2.Commit (changes, new NullProgressMonitor ()); - if (DOT_DIR == ".git") { - repo3 = (GitRepository)repo2; - repo3.Push (new NullProgressMonitor (), repo3.GetCurrentRemote (), repo3.GetCurrentBranch ()); - } + PostCommit (repo2); repo.Update (repo.RootPath, true, new NullProgressMonitor ()); Assert.True (File.Exists (rootCheckout + "testfile2")); @@ -158,11 +140,11 @@ namespace MonoDevelop.VersionControl.Tests { string added = rootCheckout + "testfile"; File.Create (added).Close (); - repo.Add (added, false, new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor ()); + repo.Add (added, false, new NullProgressMonitor ()); ChangeSet changes = repo.CreateChangeSet (repo.RootPath); changes.AddFile (added); changes.GlobalComment = "File committed"; - repo.Commit (changes, new MonoDevelop.Core.ProgressMonitoring.NullProgressMonitor ()); + repo.Commit (changes, new NullProgressMonitor ()); foreach (Revision rev in repo.GetHistory (added, null)) { Assert.AreEqual ("File committed", rev.Message); } diff --git a/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/BaseSvnRepositoryTests.cs b/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/BaseSvnRepositoryTests.cs index 6397d6ff94..6a592846ca 100644 --- a/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/BaseSvnRepositoryTests.cs +++ b/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/BaseSvnRepositoryTests.cs @@ -78,6 +78,7 @@ namespace MonoDevelop.VersionControl.Subversion.Tests // Check out the repository.
Checkout (rootCheckout, repoLocation);
+ repo = GetRepo (rootCheckout, repoLocation);
DOT_DIR = ".svn";
}
}
diff --git a/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/RepositoryTests.cs b/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/RepositoryTests.cs index f87d0a5928..a0e3a20ddb 100644 --- a/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/RepositoryTests.cs +++ b/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/RepositoryTests.cs @@ -76,14 +76,10 @@ namespace VersionControl.Subversion.Win32.Tests Assert.AreEqual (difftext, repo.GenerateDiff (added, repo.GetVersionInfo (added)).Content.Replace ("\n", "\r\n"));
}
- #region Util
-
protected override Repository GetRepo (string path, string url)
{
return new SubversionRepository (new SvnSharpClient (), url, path);
}
-
- #endregion
}
}
diff --git a/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/VersionControl.Subversion.Win32.Tests.csproj b/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/VersionControl.Subversion.Win32.Tests.csproj index 1a6125dfff..0432e6be3e 100644 --- a/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/VersionControl.Subversion.Win32.Tests.csproj +++ b/extras/VersionControl.Subversion.Win32/VersionControl.Subversion.Win32.Tests/VersionControl.Subversion.Win32.Tests.csproj @@ -46,9 +46,6 @@ <HintPath>..\..\..\main\build\AddIns\VersionControl\MonoDevelop.VersionControl.Subversion.dll</HintPath> <Private>False</Private> </Reference> - <Reference Include="MonoDevelop.VersionControl.Git"> - <HintPath>..\..\..\main\build\AddIns\VersionControl\MonoDevelop.VersionControl.Git.dll</HintPath> - </Reference> </ItemGroup> <ItemGroup> <Compile Include="RepositoryTests.cs" /> |