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


C# TestHelpers.TemporaryCloneOfTestRepo类代码示例

本文整理汇总了C#中LibGit2Sharp.Tests.TestHelpers.TemporaryCloneOfTestRepo的典型用法代码示例。如果您正苦于以下问题:C# TemporaryCloneOfTestRepo类的具体用法?C# TemporaryCloneOfTestRepo怎么用?C# TemporaryCloneOfTestRepo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TemporaryCloneOfTestRepo类属于LibGit2Sharp.Tests.TestHelpers命名空间,在下文中一共展示了TemporaryCloneOfTestRepo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BlindlyMovingABranchOverAnExistingOneThrows

 public void BlindlyMovingABranchOverAnExistingOneThrows()
 {
     using (var path = new TemporaryCloneOfTestRepo())
     using (var repo = new Repository(path.RepositoryPath))
     {
         Assert.Throws<ApplicationException>(() => repo.Branches.Move("br2", "test"));
     }
 }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:8,代码来源:BranchFixture.cs

示例2: BlindlyCreatingALightweightTagOverAnExistingOneThrows

 public void BlindlyCreatingALightweightTagOverAnExistingOneThrows()
 {
     using (var path = new TemporaryCloneOfTestRepo())
     using (var repo = new Repository(path.RepositoryPath))
     {
         Assert.Throws<ApplicationException>(() => repo.Tags.Create("e90810b", "refs/heads/br2"));
     }
 }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:8,代码来源:TagFixture.cs

示例3: BlindlyCreatingAnAnnotatedTagOverAnExistingOneThrows

 public void BlindlyCreatingAnAnnotatedTagOverAnExistingOneThrows()
 {
     using (var path = new TemporaryCloneOfTestRepo())
     using (var repo = new Repository(path.RepositoryPath))
     {
         Assert.Throws<ApplicationException>(() => repo.Tags.Create("e90810b", "refs/heads/br2", signatureNtk, "a nice message"));
     }
 }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:8,代码来源:TagFixture.cs

示例4: BlindlyCreatingADirectReferenceOverAnExistingOneThrows

 public void BlindlyCreatingADirectReferenceOverAnExistingOneThrows()
 {
     using (var path = new TemporaryCloneOfTestRepo())
     using (var repo = new Repository(path.RepositoryPath))
     {
         Assert.Throws<ApplicationException>(() => repo.Refs.Create("refs/heads/master", "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
     }
 }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:8,代码来源:ReferenceFixture.cs

示例5: BlindlyCreatingASymbolicReferenceOverAnExistingOneThrows

 public void BlindlyCreatingASymbolicReferenceOverAnExistingOneThrows()
 {
     using (var path = new TemporaryCloneOfTestRepo())
     using (var repo = new Repository(path.RepositoryPath))
     {
         Assert.Throws<ApplicationException>(() => repo.Refs.Create("HEAD", "refs/head/br2"));
     }
 }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:8,代码来源:ReferenceFixture.cs

示例6: CanCreateALightweightTagFromABranchName

 public void CanCreateALightweightTagFromABranchName()
 {
     using (var path = new TemporaryCloneOfTestRepo())
     using (var repo = new Repository(path.RepositoryPath))
     {
         var newTag = repo.Tags.Create("i_am_lightweight", "refs/heads/master");
         newTag.IsAnnotated.ShouldBeFalse();
         newTag.ShouldNotBeNull();
     }
 }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:10,代码来源:TagFixture.cs

示例7: CanCreateALightWeightTagFromAbbreviatedSha

 public void CanCreateALightWeightTagFromAbbreviatedSha()
 {
     using (var path = new TemporaryCloneOfTestRepo())
     using (var repo = new Repository(path.RepositoryPath))
     {
         var newTag = repo.Tags.Create("i_am_lightweight", commitE90810BSha.Substring(0, 17));
         newTag.ShouldNotBeNull();
         newTag.IsAnnotated.ShouldBeFalse();
     }
 }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:10,代码来源:TagFixture.cs

示例8: ADeletedTagCannotBeLookedUp

        public void ADeletedTagCannotBeLookedUp()
        {
            using (var path = new TemporaryCloneOfTestRepo())
            using (var repo = new Repository(path.RepositoryPath))
            {
                const string tagName = "e90810b";

                repo.Tags.Delete(tagName);
                repo.Tags[tagName].ShouldBeNull();
            }
        }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:11,代码来源:TagFixture.cs

示例9: ADeletedReferenceCannotBeLookedUp

        public void ADeletedReferenceCannotBeLookedUp()
        {
            using (var path = new TemporaryCloneOfTestRepo())
            using (var repo = new Repository(path.RepositoryPath))
            {
                const string refName = "refs/heads/test";

                repo.Refs.Delete(refName);
                repo.Refs[refName].ShouldBeNull();
            }
        }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:11,代码来源:ReferenceFixture.cs

示例10: CanCreateBranchFromExplicitHead

 public void CanCreateBranchFromExplicitHead()
 {
     using (var path = new TemporaryCloneOfTestRepo())
     using (var repo = new Repository(path.RepositoryPath))
     {
         const string name = "unit_test";
         var newBranch = repo.CreateBranch(name, "HEAD");
         newBranch.ShouldNotBeNull();
         newBranch.Tip.Sha.ShouldEqual("4c062a6361ae6959e06292c1fa5e2822d9c96345");
     }
 }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:11,代码来源:BranchFixture.cs

示例11: CanCheckoutAnExistingBranch

        public void CanCheckoutAnExistingBranch()
        {
            using (var path = new TemporaryCloneOfTestRepo())
            using (var repo = new Repository(path.RepositoryPath))
            {
                var master = repo.Branches["master"];
                master.IsCurrentRepositoryHead.ShouldBeTrue();

                var test = repo.Branches.Checkout("test");

                test.IsCurrentRepositoryHead.ShouldBeTrue();
                master.IsCurrentRepositoryHead.ShouldBeFalse();
            }
        }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:14,代码来源:BranchFixture.cs

示例12: CanCreateADirectReference

        public void CanCreateADirectReference()
        {
            const string name = "refs/heads/unit_test";

            using (var path = new TemporaryCloneOfTestRepo())
            using (var repo = new Repository(path.RepositoryPath))
            {
                var newRef = (DirectReference) repo.Refs.Create(name, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
                newRef.ShouldNotBeNull();
                newRef.CanonicalName.ShouldEqual(name);
                newRef.Target.ShouldNotBeNull();
                newRef.Target.Sha.ShouldEqual("be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
                newRef.TargetIdentifier.ShouldEqual(newRef.Target.Sha);
                repo.Refs[name].ShouldNotBeNull();
            }
        }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:16,代码来源:ReferenceFixture.cs

示例13: CanCreateBranchFromImplicitHead

 public void CanCreateBranchFromImplicitHead()
 {
     using (var path = new TemporaryCloneOfTestRepo())
     using (var repo = new Repository(path.RepositoryPath))
     {
         const string name = "unit_test";
         var newBranch = repo.CreateBranch(name);
         newBranch.ShouldNotBeNull();
         newBranch.Name.ShouldEqual(name);
         newBranch.CanonicalName.ShouldEqual("refs/heads/" + name);
         newBranch.IsCurrentRepositoryHead.ShouldBeFalse();
         newBranch.Tip.ShouldNotBeNull();
         newBranch.Tip.Sha.ShouldEqual("4c062a6361ae6959e06292c1fa5e2822d9c96345");
         repo.Branches.SingleOrDefault(p => p.Name == name).ShouldNotBeNull();
     }
 }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:16,代码来源:BranchFixture.cs

示例14: CanCreateBranch

        public void CanCreateBranch()
        {
            using (var path = new TemporaryCloneOfTestRepo())
            using (var repo = new Repository(path.RepositoryPath))
            {
                const string name = "unit_test";
                var newBranch = repo.CreateBranch(name, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
                newBranch.ShouldNotBeNull();
                newBranch.Name.ShouldEqual(name);
                newBranch.CanonicalName.ShouldEqual("refs/heads/" + name);
                newBranch.Tip.ShouldNotBeNull();
                newBranch.Tip.Sha.ShouldEqual("be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
                repo.Branches.SingleOrDefault(p => p.Name == name).ShouldNotBeNull();

                repo.Branches.Delete(newBranch.Name);
            }
        }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:17,代码来源:BranchFixture.cs

示例15: TwoBranchesPointingAtTheSameCommitAreNotBothCurrent

        public void TwoBranchesPointingAtTheSameCommitAreNotBothCurrent()
        {
            using (var path = new TemporaryCloneOfTestRepo())
            using (var repo = new Repository(path.RepositoryPath))
            {
                var master = repo.Branches["refs/heads/master"];

                var newBranch = repo.Branches.Create("clone-of-master", master.Tip.Sha);
                newBranch.IsCurrentRepositoryHead.ShouldBeFalse();
            }
        }
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:11,代码来源:BranchFixture.cs


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