當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。