本文整理汇总了C#中LibGit2Sharp.Tests.TestHelpers.TemporaryCloneOfTestRepo类的典型用法代码示例。如果您正苦于以下问题:C# TemporaryCloneOfTestRepo类的具体用法?C# TemporaryCloneOfTestRepo怎么用?C# TemporaryCloneOfTestRepo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TemporaryCloneOfTestRepo类属于LibGit2Sharp.Tests.TestHelpers命名空间,在下文中一共展示了TemporaryCloneOfTestRepo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: CanUpdateTargetOnReference
public void CanUpdateTargetOnReference()
{
const string masterRef = "refs/heads/master";
using (var path = new TemporaryCloneOfTestRepo())
using (var repo = new Repository(path.RepositoryPath))
{
var sha = repo.Refs["refs/heads/test"].ResolveToDirectReference().Target.Sha;
var master = repo.Refs[masterRef];
master.ResolveToDirectReference().Target.Sha.ShouldNotEqual(sha);
var updated = repo.Refs.UpdateTarget(masterRef, sha);
master = repo.Refs[masterRef];
master.ShouldEqual(updated);
master.ResolveToDirectReference().Target.Sha.ShouldEqual(sha);
}
}
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:18,代码来源:ReferenceFixture.cs
示例17: DeletingBranchWithBadParamsThrows
public void DeletingBranchWithBadParamsThrows()
{
using (var path = new TemporaryCloneOfTestRepo())
using (var repo = new Repository(path.RepositoryPath))
{
Assert.Throws<ArgumentException>(() => repo.Branches.Delete(string.Empty));
Assert.Throws<ArgumentNullException>(() => repo.Branches.Delete(null));
}
}
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:9,代码来源:BranchFixture.cs
示例18: CreatingABranchTriggersTheCreationOfADirectReference
public void CreatingABranchTriggersTheCreationOfADirectReference()
{
using (var path = new TemporaryCloneOfTestRepo())
using (var repo = new Repository(path.RepositoryPath))
{
var newBranch = repo.CreateBranch("clone-of-master");
newBranch.IsCurrentRepositoryHead.ShouldBeFalse();
var commitId = repo.Head.Tip.Id;
newBranch.Tip.Id.ShouldEqual(commitId);
var reference = repo.Refs[newBranch.CanonicalName];
reference.ShouldNotBeNull();
Assert.IsInstanceOf(typeof (DirectReference), reference);
}
}
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:16,代码来源:BranchFixture.cs
示例19: CanLookupAMovedReference
public void CanLookupAMovedReference()
{
using (var path = new TemporaryCloneOfTestRepo())
using (var repo = new Repository(path.RepositoryPath))
{
const string oldName = "refs/tags/test";
const string newName = "refs/atic/tagtest";
Reference moved = repo.Refs.Move(oldName, newName);
Reference lookedUp = repo.Refs[newName];
moved.ShouldEqual(lookedUp);
}
}
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:14,代码来源:ReferenceFixture.cs
示例20: CanMoveABranchWhileOverwritingAnExistingOne
public void CanMoveABranchWhileOverwritingAnExistingOne()
{
using (var path = new TemporaryCloneOfTestRepo())
using (var repo = new Repository(path.RepositoryPath))
{
var test = repo.Branches["test"];
test.ShouldNotBeNull();
var br2 = repo.Branches["br2"];
br2.ShouldNotBeNull();
var newBranch = repo.Branches.Move("br2", "test", true);
newBranch.Name.ShouldEqual("test");
repo.Branches["br2"].ShouldBeNull();
var newTest = repo.Branches["test"];
newTest.ShouldNotBeNull();
newTest.ShouldEqual(newBranch);
newTest.Tip.ShouldEqual(br2.Tip);
}
}
开发者ID:paulcbetts,项目名称:libgit2sharp,代码行数:23,代码来源:BranchFixture.cs
注:本文中的LibGit2Sharp.Tests.TestHelpers.TemporaryCloneOfTestRepo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论