Esempio n. 1
0
        public void IssueMethods_Null()
        {
            ZenHubClient zh  = new ZenHubClient("dummy");
            var          icl = zh.GetIssueClient(1, 2);

            Assert.Throws <ArgumentNullException>(() => icl.AddBlockedByAsync(null).GetAwaiter().GetResult());
            Assert.Throws <ArgumentNullException>(() => icl.RemoveBlockedByAsync(null).GetAwaiter().GetResult());
        }
Esempio n. 2
0
        public void ReleasesMethods_Null()
        {
            ZenHubClient zh    = new ZenHubClient("dummy");
            var          relCl = zh.GetReleaseClient("release");

            Assert.Throws <ArgumentNullException>(() => relCl.AddRepositoryAsync(null).GetAwaiter().GetResult());
            Assert.Throws <ArgumentNullException>(() => relCl.RemoveRepositoryAsync(null).GetAwaiter().GetResult());
        }
Esempio n. 3
0
        public void RepositoryMethods_Null()
        {
            ZenHubClient zh    = new ZenHubClient("dummy");
            var          repCl = zh.GetRepositoryClient(1);

            Assert.Throws <ArgumentNullException>(() => repCl.GetMilestoneStartAsync(null).GetAwaiter().GetResult());
            Assert.Throws <ArgumentNullException>(() => repCl.SetMilestoneStartAsync(null, DateTime.Now).GetAwaiter().GetResult());
        }
        public ChangelogGenerator(Options opts)
        {
            Options      = opts;
            GitHubClient = new GitHubClient(new ProductHeaderValue("nuget-changelog-generator"));
            var creds = new Credentials(Options.GitHubToken);

            GitHubClient.Credentials = creds;
            ZenHubClient             = new ZenHubClient(Options.ZenHubToken);
        }
        public void Initialize()
        {
            s_mockServer = new MockServer();
            s_mockServer.RegisterServer();

            ZenHubClientOptions options = new ZenHubClientOptions()
            {
                EndPoint = s_mockServer.EndPoint
            };

            _zenhubClient = new ZenHubClient("dummyToken", options);
        }
Esempio n. 6
0
 public AlertHookController(
     IGitHubTokenProvider tokenProvider,
     ZenHubClient zenHub,
     IOptions <GitHubConnectionOptions> githubOptions,
     IOptions <GitHubClientOptions> githubClientOptions,
     ILogger <AlertHookController> logger)
 {
     _tokenProvider       = tokenProvider;
     _zenHub              = zenHub;
     _githubOptions       = githubOptions;
     _githubClientOptions = githubClientOptions;
     _logger              = logger;
 }
        public LabelUpdateHelper(Options options)
        {
            RepoName    = options.Repo;
            GithubToken = options.GitHubToken;
            ZenhubToken = options.ZenHubToken;

            //only run issues which is in the range, if the totall issue number exceed the rate limiting https://developer.github.com/v3/#rate-limiting
            IssueNumberFrom = options.IssueNumFrom;
            IssueNumberTo   = options.IssueNumTo;

            //if IssueNumberTo is not specified in the command, or the "from" is larger than "to" , then process all the issues
            if (IssueNumberTo == 0 || (IssueNumberFrom > IssueNumberTo))
            {
                ProcessAll = true;
            }

            GitHubClient = new GitHubClient(new ProductHeaderValue("nuget-update-pipeline-label"));
            var creds = new Credentials(GithubToken);

            GitHubClient.Credentials = creds;
            ZenHubClient             = new ZenHubClient(ZenhubToken);

            //summaryReport = new SummaryReport();
        }
Esempio n. 8
0
 public void RefreshZenHubToken(string newToken)
 {
     using IDisposable scope = _fileLogger.CreateScope("Refreshing ZenHub token");
     _zenHubClient           = new ZenHubClient(newToken);
 }
Esempio n. 9
0
 public void RefreshZenHubToken(string newToken)
 {
     _zenHubClient = new ZenHubClient(newToken);
 }
Esempio n. 10
0
        public void GetRepositoryClient_Null()
        {
            ZenHubClient zh = new ZenHubClient("dummy");

            Assert.Throws <ArgumentNullException>(() => zh.GetRepositoryClient(null));
        }