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


C# Helpers.RepositoryContext类代码示例

本文整理汇总了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;
    }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:32,代码来源:DeploymentStatusClientTests.cs

示例2: AssigneesClientTests

    public AssigneesClientTests()
    {
        _github = Helper.GetAuthenticatedClient();
        var repoName = Helper.MakeNameWithTimestamp("public-repo");

        _context = _github.CreateRepositoryContext(new NewRepository(repoName)).Result;
    }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:7,代码来源:AssigneesClientTests.cs

示例3: RepositoryDeployKeysClientTests

    public RepositoryDeployKeysClientTests()
    {
        var github = Helper.GetAuthenticatedClient();

        _fixture = github.Repository.DeployKeys;
        _context = github.CreateRepositoryContext("public-repo").Result;
    }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:7,代码来源:RepositoryDeployKeysClientTests.cs

示例4: TheCreateReactionMethod

 public TheCreateReactionMethod()
 {
     _github = Helper.GetAuthenticatedClient();
     var repoName = Helper.MakeNameWithTimestamp("public-repo");
     _issuesClient = _github.Issue;
     _context = _github.CreateRepositoryContext(new NewRepository(repoName)).Result;
 }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:7,代码来源:IssueCommentReactionsClientTests.cs

示例5: BlobClientTests

    public BlobClientTests()
    {
        var github = Helper.GetAuthenticatedClient();
        _fixture = github.Git.Blob;

        _context = github.CreateRepositoryContext("public-repo").Result;
    }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:7,代码来源:BlobClientTests.cs

示例6: TheGetReleasesMethod

        public TheGetReleasesMethod()
        {
            var github = Helper.GetAuthenticatedClient();
            _releaseClient = github.Repository.Release;

            _context = github.CreateRepositoryContext("public-repo").Result;
        }
开发者ID:KonstantinDavidov,项目名称:octokit.net,代码行数:7,代码来源:ReleasesClientTests.cs

示例7: ReferencesClientTests

    public ReferencesClientTests()
    {
        _github = Helper.GetAuthenticatedClient();

        _fixture = _github.Git.Reference;

        _context = _github.CreateRepositoryContext("public-repo").Result;
    }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:8,代码来源:ReferencesClientTests.cs

示例8: TreeClientTests

    public TreeClientTests()
    {
        _github = Helper.GetAuthenticatedClient();

        _fixture = _github.GitDatabase.Tree;

        _context = _github.CreateRepositoryContext("public-repo").Result;
    }
开发者ID:natsihit2,项目名称:octokit.net,代码行数:8,代码来源:TreeClientTests.cs

示例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;
        }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:9,代码来源:ObservableIssueTimelineClientTests.cs

示例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;
    }
开发者ID:daveaglick,项目名称:octokit.net,代码行数:9,代码来源:MilestonesClientTests.cs

示例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;
    }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:9,代码来源:PullRequestReviewCommentsClientTests.cs

示例12: MergingClientTests

    public MergingClientTests()
    {
        _github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
        {
            Credentials = Helper.Credentials
        };

        _fixture = _github.Repository.Merging;
        _context = _github.CreateRepositoryContext("public-repo").Result;
    }
开发者ID:cloudRoutine,项目名称:octokit.net,代码行数:10,代码来源:MergingClientTests.cs

示例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();
        }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:15,代码来源:StarredClientTests.cs

示例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;
            }
开发者ID:Sarmad93,项目名称:octokit.net,代码行数:16,代码来源:TagsClientTests.cs

示例15: RepositorySummary

 public RepositorySummary(RepositoryContext context)
 {
     Name = context.Repository.Name;
     Owner = context.Repository.Owner.Login;
 }
开发者ID:RadicalLove,项目名称:octokit.net,代码行数:5,代码来源:StatisticsClientTests.cs


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