本文整理汇总了C#中Octokit.Tests.Integration.Helpers.RepositoryContext类的典型用法代码示例。如果您正苦于以下问题:C# RepositoryContext类的具体用法?C# RepositoryContext怎么用?C# RepositoryContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryContext类属于Octokit.Tests.Integration.Helpers命名空间,在下文中一共展示了RepositoryContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeploymentStatusClientTests
public DeploymentStatusClientTests()
{
var github = Helper.GetAuthenticatedClient();
_deploymentsClient = github.Repository.Deployment;
_context = github.CreateRepositoryContext("public-repo").Result;
var blob = new NewBlob
{
Content = "Hello World!",
Encoding = EncodingType.Utf8
};
var blobResult = github.Git.Blob.Create(_context.RepositoryOwner, _context.RepositoryName, blob).Result;
var newTree = new NewTree();
newTree.Tree.Add(new NewTreeItem
{
Type = TreeType.Blob,
Mode = FileMode.File,
Path = "README.md",
Sha = blobResult.Sha
});
var treeResult = github.Git.Tree.Create(_context.RepositoryOwner, _context.RepositoryName, newTree).Result;
var newCommit = new NewCommit("test-commit", treeResult.Sha);
var commit = github.Git.Commit.Create(_context.RepositoryOwner, _context.RepositoryName, newCommit).Result;
var newDeployment = new NewDeployment(commit.Sha) { AutoMerge = false };
_deployment = _deploymentsClient.Create(_context.RepositoryOwner, _context.RepositoryName, newDeployment).Result;
}
示例2: AssigneesClientTests
public AssigneesClientTests()
{
_github = Helper.GetAuthenticatedClient();
var repoName = Helper.MakeNameWithTimestamp("public-repo");
_context = _github.CreateRepositoryContext(new NewRepository(repoName)).Result;
}
示例3: RepositoryDeployKeysClientTests
public RepositoryDeployKeysClientTests()
{
var github = Helper.GetAuthenticatedClient();
_fixture = github.Repository.DeployKeys;
_context = github.CreateRepositoryContext("public-repo").Result;
}
示例4: TheCreateReactionMethod
public TheCreateReactionMethod()
{
_github = Helper.GetAuthenticatedClient();
var repoName = Helper.MakeNameWithTimestamp("public-repo");
_issuesClient = _github.Issue;
_context = _github.CreateRepositoryContext(new NewRepository(repoName)).Result;
}
示例5: BlobClientTests
public BlobClientTests()
{
var github = Helper.GetAuthenticatedClient();
_fixture = github.Git.Blob;
_context = github.CreateRepositoryContext("public-repo").Result;
}
示例6: TheGetReleasesMethod
public TheGetReleasesMethod()
{
var github = Helper.GetAuthenticatedClient();
_releaseClient = github.Repository.Release;
_context = github.CreateRepositoryContext("public-repo").Result;
}
示例7: ReferencesClientTests
public ReferencesClientTests()
{
_github = Helper.GetAuthenticatedClient();
_fixture = _github.Git.Reference;
_context = _github.CreateRepositoryContext("public-repo").Result;
}
示例8: TreeClientTests
public TreeClientTests()
{
_github = Helper.GetAuthenticatedClient();
_fixture = _github.GitDatabase.Tree;
_context = _github.CreateRepositoryContext("public-repo").Result;
}
示例9: ObservableIssueTimelineClientTests
public ObservableIssueTimelineClientTests()
{
var github = Helper.GetAuthenticatedClient();
_client = new ObservableGitHubClient(github);
var reponame = Helper.MakeNameWithTimestamp("public-repo");
_context = github.CreateRepositoryContext(new NewRepository(reponame)).Result;
}
示例10: MilestonesClientTests
public MilestonesClientTests()
{
var github = Helper.GetAuthenticatedClient();
_milestonesClient = github.Issue.Milestone;
var repoName = Helper.MakeNameWithTimestamp("public-repo");
_context = github.CreateRepositoryContext(new NewRepository(repoName)).Result;
}
示例11: PullRequestReviewCommentsClientTests
public PullRequestReviewCommentsClientTests()
{
_github = Helper.GetAuthenticatedClient();
_client = _github.PullRequest.Comment;
// We'll create a pull request that can be used by most tests
_context = _github.CreateRepositoryContext("test-repo").Result;
}
示例12: MergingClientTests
public MergingClientTests()
{
_github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
{
Credentials = Helper.Credentials
};
_fixture = _github.Repository.Merging;
_context = _github.CreateRepositoryContext("public-repo").Result;
}
示例13: StarredClientTests
public StarredClientTests()
{
_client = Helper.GetAuthenticatedClient();
_fixture = _client.Activity.Starring;
var github = Helper.GetAuthenticatedClient();
var repoName = Helper.MakeNameWithTimestamp("public-repo1");
_repositoryContext = github.CreateRepositoryContext(new NewRepository(repoName)).Result;
_fixture.RemoveStarFromRepo(_repositoryContext.RepositoryOwner, _repositoryContext.RepositoryName).Wait();
_fixture.RemoveStarFromRepo("octokit", "octokit.net").Wait();
_fixture.StarRepo(_repositoryContext.RepositoryOwner, _repositoryContext.RepositoryName).Wait();
_fixture.StarRepo("octokit", "octokit.net").Wait();
}
示例14: TheGetMethod
public TheGetMethod()
{
var github = Helper.GetAuthenticatedClient();
fixture = github.Git.Tag;
context = github.CreateRepositoryContext("public-repo").Result;
var blob = new NewBlob
{
Content = "Hello World!",
Encoding = EncodingType.Utf8
};
var blobResult = github.Git.Blob.Create(context.RepositoryOwner, context.RepositoryName, blob).Result;
sha = blobResult.Sha;
}
示例15: RepositorySummary
public RepositorySummary(RepositoryContext context)
{
Name = context.Repository.Name;
Owner = context.Repository.Owner.Login;
}