当前位置: 首页>>代码示例>>C#>>正文


C# RepositorySetup.AssertHeadCount方法代码示例

本文整理汇总了C#中LibChorus.TestUtilities.RepositorySetup.AssertHeadCount方法的典型用法代码示例。如果您正苦于以下问题:C# RepositorySetup.AssertHeadCount方法的具体用法?C# RepositorySetup.AssertHeadCount怎么用?C# RepositorySetup.AssertHeadCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LibChorus.TestUtilities.RepositorySetup的用法示例。


在下文中一共展示了RepositorySetup.AssertHeadCount方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SynchNow_OnDefaultBranchAndAnotherBranchExists_DoesNotMergeWithIt

 public void SynchNow_OnDefaultBranchAndAnotherBranchExists_DoesNotMergeWithIt()
 {
     using (var repo = new RepositorySetup("bob"))
     {
         repo.AddAndCheckinFile("test.txt", "hello");
         repo.AssertHeadCount(1);
         repo.ChangeFileOnNamedBranchAndComeBack("test.txt", "blah", "mybranch");
        //NB: this used to pass prior to hg 1.5, but, well, it shouldn't!
         //	Shouldn't there be two heads after the branch, above? (jh, April 2010)
         //			repo.AssertHeadCount(1);
         repo.ChangeFileAndCommit("test.txt", "hello there", "second");
         repo.AssertHeadCount(2);
         repo.CheckinAndPullAndMerge();
         repo.AssertHeadCount(2);
     }
 }
开发者ID:regnrand,项目名称:chorus,代码行数:16,代码来源:RevisionMergeBehaviorTests.cs

示例2: SynchNow_OnNamedBranchAndDefaultBranchExists_DoesNotMergeWithIt

        public void SynchNow_OnNamedBranchAndDefaultBranchExists_DoesNotMergeWithIt()
        {
            using (var repo = new RepositorySetup("bob"))
            {
                if (repo.Synchronizer == null)
                    repo.Synchronizer = repo.CreateSynchronizer();
                repo.Synchronizer.SynchronizerAdjunct = new ProgrammableSynchronizerAdjunct("default");
                repo.AddAndCheckinFile("test.txt", "apple");
                var afterFirstCheckin = repo.CreateBookmarkHere();
                repo.ChangeFileAndCommit("test.txt", "pear", "second on default");

                afterFirstCheckin.Go();
                repo.Repository.BranchingHelper.Branch(new ConsoleProgress(), "animals");
                repo.Synchronizer.SynchronizerAdjunct = new ProgrammableSynchronizerAdjunct("animals");
                repo.ChangeFileAndCommit("test.txt", "dog", "first on animals");
                var animalHead = repo.CreateBookmarkHere();

                repo.AssertHeadCount(2);
                repo.CheckinAndPullAndMerge();
                repo.AssertHeadCount(2);
                animalHead.AssertRepoIsAtThisPoint();
            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:23,代码来源:RevisionMergeBehaviorTests.cs

示例3: SecondCheckin_Invalid_BacksOut

 public void SecondCheckin_Invalid_BacksOut()
 {
     using (var bob = new RepositorySetup("bob"))
     {
         bob.AddAndCheckinFile("test.chorusTest", "hello");
         bob.ChangeFile("test.chorusTest",ChorusTestFileHandler.GetInvalidContents());
         using (var cop = new CommitCop(bob.Repository, ChorusFileTypeHandlerCollection.CreateWithTestHandlerOnly(), bob.Progress))
         {
             Assert.IsFalse(string.IsNullOrEmpty(cop.ValidationResult));
             bob.Repository.Commit(false, "bad data");
         }
         Debug.WriteLine(bob.Repository.GetLog(-1));
         bob.AssertHeadCount(1);
         bob.AssertLocalRevisionNumber(2);
         bob.AssertFileContents("test.chorusTest", "hello");
     }
 }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:17,代码来源:CommitCopTests.cs

示例4: InitialFileCommit_Invalid_BacksOut

 public void InitialFileCommit_Invalid_BacksOut()
 {
     using(var bob = new RepositorySetup("bob"))
     {
         bob.AddAndCheckinFile("validfile.chorustest", "valid contents");
         bob.ChangeFile("test.chorusTest", ChorusTestFileHandler.GetInvalidContents());
         using(var cop = new CommitCop(bob.Repository, ChorusFileTypeHandlerCollection.CreateWithTestHandlerOnly(), bob.Progress))
         {
             bob.Repository.AddAndCheckinFile("test.chorusTest");
             Assert.That(cop.ValidationResult, Is.StringContaining("Failed"));
         }
         Debug.WriteLine(bob.Repository.GetLog(-1));
         bob.AssertHeadCount(1);
         bob.AssertLocalRevisionNumber(2);
         bob.AssertFileDoesNotExistInRepository("test.chorusTest");
         bob.AssertFileExistsInRepository("validfile.chorustest");
     }
 }
开发者ID:regnrand,项目名称:chorus,代码行数:18,代码来源:CommitCopTests.cs

示例5: HasFileHandlers_ValidCommit_Validates_DoesNothing

 public void HasFileHandlers_ValidCommit_Validates_DoesNothing()
 {
     using(var bob = new RepositorySetup("bob"))
     {
         bob.AddAndCheckinFile("test.chorusTest", "hello");
         using(var cop = new CommitCop(bob.Repository, ChorusFileTypeHandlerCollection.CreateWithTestHandlerOnly(), bob.Progress))
         {
             bob.ChangeFile("test.chorusTest", "aloha");
             bob.AddAndCheckinFile("test2.chorusTest", "hi");
             Assert.IsNullOrEmpty(cop.ValidationResult);
         }
         bob.AssertHeadCount(1);
         bob.AssertLocalRevisionNumber(1);
         bob.AssertFileExistsInRepository("test2.chorusTest");
         bob.AssertFileContents("test.chorusTest", "aloha");
         bob.AssertFileContents("test2.chorusTest", "hi");
     }
 }
开发者ID:regnrand,项目名称:chorus,代码行数:18,代码来源:CommitCopTests.cs

示例6: Sync_ModifiedFileIsInvalid_CheckedInButThenBackedOut

        public void Sync_ModifiedFileIsInvalid_CheckedInButThenBackedOut()
        {
            /*
                @  changeset:   2
                |  summary:     [Backout due to validation Failure]
                |
                o  changeset:   1
                |  summary:     missing checkin description
                |
                o  changeset:   0
                summary:     Add test.chorusTest
             */
            using (var bob = new RepositorySetup("bob"))
            {
                bob.AddAndCheckinFile("test.chorusTest", "original");
                bob.AssertLocalRevisionNumber(0);
                bob.ChangeFile("test.chorusTest", ChorusTestFileHandler.GetInvalidContents());
                bob.CheckinAndPullAndMerge();
                bob.AssertLocalRevisionNumber(2);
                bob.AssertHeadCount(1);  
                bob.AssertLocalRevisionNumber(int.Parse(bob.Repository.GetTip().Number.LocalRevisionNumber));
                Debug.WriteLine(bob.Repository.GetLog(-1));

            }
        }
开发者ID:sillsdev,项目名称:chack,代码行数:25,代码来源:Synchronizer.BadSituationTests.cs

示例7: Sync_ExistingRejectChangeSet_NotMergedIn

        public void Sync_ExistingRejectChangeSet_NotMergedIn()
        {
            using (var bob = new RepositorySetup("bob"))
            {
                bob.AddAndCheckinFile("test.txt", "original");
               
                bob.CreateRejectForkAndComeBack();

                bob.ChangeFileAndCommit("test.txt", "ok", "goodGuy"); //move on so we have two distinct branches
                bob.AssertHeadCount(2);

                bob.CheckinAndPullAndMerge(null);

                Assert.AreEqual("goodGuy", bob.Repository.GetRevisionWorkingSetIsBasedOn().Summary);
                bob.AssertLocalRevisionNumber(3);
                bob.AssertHeadCount(2);
            }
        }
开发者ID:sillsdev,项目名称:chack,代码行数:18,代码来源:Synchronizer.BadSituationTests.cs

示例8: Sync_FileLockedForReadingDuringMerge_LeftWithMultipleHeads

 public void Sync_FileLockedForReadingDuringMerge_LeftWithMultipleHeads()
 {
     HgRunner.TimeoutSecondsOverrideForUnitTests = 1;
     using (var bob = new RepositorySetup("bob"))
     {
         bob.ProjectFolderConfig.IncludePatterns.Add("*.txt");
         bob.AddAndCheckinFile("one.txt", "hello");
         using (var sally = new RepositorySetup("sally", bob))
         {
             bob.AddAndCheckinFile("one.txt", "hello-bob");
             using (sally.GetFileLockForReading("one.txt"))
             {
                 sally.CheckinAndPullAndMerge(bob);
             }
             sally.AssertHeadCount(2);
         }
     }
 }
开发者ID:sillsdev,项目名称:chack,代码行数:18,代码来源:Synchronizer.BadSituationTests.cs

示例9: Sync_MergeFailure_NoneOfTheOtherGuysFilesMakeItIntoWorkingDirectory

        public void Sync_MergeFailure_NoneOfTheOtherGuysFilesMakeItIntoWorkingDirectory()
        {
            using (var bob = new RepositorySetup("bob"))
            {
                bob.ProjectFolderConfig.IncludePatterns.Add("*.txt");
                bob.AddAndCheckinFile("aaa.txt", "apple");
                bob.AddAndCheckinFile("bbb.txt", "bread");
                bob.AddAndCheckinFile("zzz.txt", "zoo");
                using (var sally = new RepositorySetup("sally", bob))
                {
                    bob.AddAndCheckinFile("aaa.txt", "bob-apple");
                    bob.AddAndCheckinFile("bbb.txt", "bob-bread");
                    bob.AddAndCheckinFile("zzz.txt", "bob-zoo");
                   using (new FailureSimulator("TextMerger-bbb.txt"))
                    {
                        sally.AddAndCheckinFile("aaa.txt", "sally-apple");
                        sally.AddAndCheckinFile("bbb.txt", "sally-bread");
                        sally.AddAndCheckinFile("zzz.txt", "sally-zipper");
                        Assert.IsFalse(sally.CheckinAndPullAndMerge(bob).Succeeded);

                       //make sure we ended up on Sally's revision, even though Bob's are newer
                        var currentRevision = sally.Repository.GetRevisionWorkingSetIsBasedOn();
                        Assert.AreEqual("sally", sally.Repository.GetRevision(currentRevision.Number.Hash).UserId);
                        
                       //sally should see no changes, because it should all be rolled back
                        sally.AssertFileContents("aaa.txt", "sally-apple");
                        sally.AssertFileContents("bbb.txt", "sally-bread");
                        sally.AssertFileContents("zzz.txt", "sally-zipper");

//                        sally.ShowInTortoise();
                       sally.AssertHeadCount(2);
                        Assert.IsFalse(sally.GetProgressString().Contains("creates new remote heads"));
                    }
                }
			}
			File.Delete(Path.Combine(Path.GetTempPath(), "TextMerger-bbb.txt"));
        }
开发者ID:sillsdev,项目名称:chack,代码行数:37,代码来源:Synchronizer.BadSituationTests.cs


注:本文中的LibChorus.TestUtilities.RepositorySetup.AssertHeadCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。