public IssuesClientTests()
 {
     _gitHubClient = Helper.GetAuthenticatedClient();
     var repoName = Helper.MakeNameWithTimestamp("public-repo");
     _issuesClient = _gitHubClient.Issue;
     _repository = _gitHubClient.Repository.Create(new NewRepository { Name = repoName }).Result;
 }
Beispiel #2
0
        private Program(FileIssuesOptions options)
        {
            _options = options;

            _issuesClient       = GitHub.GetIssuesClient(_options.Token);
            _issuesLabelsClient = GitHub.GetIssuesLabelsClient(_options.Token);
        }
 public TheCreateReactionMethod()
 {
     _github = Helper.GetAuthenticatedClient();
     var repoName = Helper.MakeNameWithTimestamp("public-repo");
     _issuesClient = _github.Issue;
     _context = _github.CreateRepositoryContext(new NewRepository(repoName)).Result;
 }
 private void Setup()
 {
     client = new GitHubClient(new Octokit.ProductHeaderValue("GitHubDataVisProject"));
     // Uncomment and add in your OAuth Token
     //client.Credentials = new Credentials(OAuth Token);
     issuesclient = client.Issue;
 }
 public IssuesClientTests()
 {
     var github = Helper.GetAuthenticatedClient();
     var repoName = Helper.MakeNameWithTimestamp("public-repo");
     _issuesClient = github.Issue;
     _context = github.CreateRepositoryContext(new NewRepository(repoName)).Result;
 }
Beispiel #6
0
        private Program(FileIssuesOptions options)
        {
            _options = options;

            _issuesClient = GitHub.GetIssuesClient(_options.Token);
            _issuesLabelsClient = GitHub.GetIssuesLabelsClient(_options.Token);
        }
        public TheCreateReactionMethod()
        {
            _github = Helper.GetAuthenticatedClient();
            var repoName = Helper.MakeNameWithTimestamp("public-repo");

            _issuesClient = _github.Issue;
            _context      = _github.CreateRepositoryContext(new NewRepository(repoName)).Result;
        }
Beispiel #8
0
    public IssuesClientTests()
    {
        _gitHubClient = Helper.GetAuthenticatedClient();
        var repoName = Helper.MakeNameWithTimestamp("public-repo");

        _issuesClient = _gitHubClient.Issue;
        _repository   = _gitHubClient.Repository.Create(new NewRepository(repoName)).Result;
    }
    public IssuesClientTests()
    {
        var github   = Helper.GetAuthenticatedClient();
        var repoName = Helper.MakeNameWithTimestamp("public-repo");

        _issuesClient = github.Issue;
        _context      = github.CreateRepositoryContext(new NewRepository(repoName)).Result;
    }
        public ObservableIssuesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.Issue;
            _connection = client.Connection;
            Assignee = new ObservableAssigneesClient(client);
            Milestone = new ObservableMilestonesClient(client);
        }
Beispiel #11
0
        public ObservableIssuesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client     = client.Issue;
            _connection = client.Connection;
            Assignee    = new ObservableAssigneesClient(client);
            Milestone   = new ObservableMilestonesClient(client);
        }
        private async Task LoadIssues(IIssuesClient client, IEnumerable <CardWrapper> cards)
        {
            foreach (var card in cards)
            {
                this._logger.LogInformation($"{nameof(LoadIssues)}: Loading issue for card '{card.Number}'...");
                await card.LoadIssue(client);

                this._logger.LogInformation($"{nameof(LoadIssues)}: {card.Summary()}");
            }
        }
Beispiel #13
0
 public IssuesClientTests()
 {
     _gitHubClient = new GitHubClient(new ProductHeaderValue("OctokitTests"))
     {
         Credentials = Helper.Credentials
     };
     var repoName = Helper.MakeNameWithTimestamp("public-repo");
     _issuesClient = _gitHubClient.Issue;
     _repository = _gitHubClient.Repository.Create(new NewRepository { Name = repoName }).Result;
 }
        public TheDeleteMethod()
        {
            var gitHubClient = Helper.GetAuthenticatedClient();

            var repoName = Helper.MakeNameWithTimestamp("public-repo");

            _context = gitHubClient.CreateRepositoryContext(new NewRepository(repoName)).Result;

            _issuesClient        = gitHubClient.Issue;
            _issueCommentsClient = gitHubClient.Issue.Comment;
        }
 public GitHubIssueTrackerTests()
 {
     _gitHubClient = Substitute.For<IGitHubClient>();
     _sut = new GitHubIssueTracker(new IssueNumberExtractor(), _gitHubClient);
     _gitReleaseNotesArguments = new GitReleaseNotesArguments
     {
         Repo = "Org/Repo",
         Token = "213"
     };
     _issuesClient = Substitute.For<IIssuesClient>();
 }
    public IssuesLabelsClientTests()
    {
        _gitHubClient = Helper.GetAuthenticatedClient();

        _issuesLabelsClient = _gitHubClient.Issue.Labels;
        _issuesClient       = _gitHubClient.Issue;
        var repoName = Helper.MakeNameWithTimestamp("public-repo");

        _repository      = _gitHubClient.Repository.Create(new NewRepository(repoName)).Result;
        _repositoryOwner = _repository.Owner.Login;
        _repositoryName  = _repository.Name;
    }
        /// <summary>
        /// Creates a <see cref="GitHubRepoIssueReaderWriter"/> object. This object is used to interface with GitHub to manage issues that are being migrated.
        /// </summary>
        public GitHubRepoIssueReaderWriter(string repoOwner, string repo, IIssuesClient issues, ISearchClient search)
        {
            ArgValidate.IsNotNullNotEmptyNotWhiteSpace(repoOwner, nameof(repoOwner));
            ArgValidate.IsNotNullNotEmptyNotWhiteSpace(repo, nameof(repo));
            ArgValidate.IsNotNull(issues, nameof(issues));
            ArgValidate.IsNotNull(search, nameof(search));

            this.repoOwner = repoOwner;
            this.repo      = repo;
            this.issues    = issues;
            this.search    = search;
        }
    public IssuesLabelsClientTests()
    {
        _gitHubClient = Helper.GetAuthenticatedClient();

        _issuesLabelsClient= _gitHubClient.Issue.Labels;
        _issuesClient = _gitHubClient.Issue;
        var repoName = Helper.MakeNameWithTimestamp("public-repo");

        _repository = _gitHubClient.Repository.Create(new NewRepository { Name = repoName }).Result;
        _repositoryOwner = _repository.Owner.Login;
        _repositoryName = _repository.Name;
    }
    public IssuesClientTests()
    {
        _gitHubClient = new GitHubClient(new ProductHeaderValue("OctokitTests"))
        {
            Credentials = Helper.Credentials
        };
        var repoName = Helper.MakeNameWithTimestamp("public-repo");

        _issuesClient = _gitHubClient.Issue;
        _repository   = _gitHubClient.Repository.Create(new NewRepository {
            Name = repoName
        }).Result;
    }
        public ObservableIssuesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client = client.Issue;
            _connection = client.Connection;
            Assignee = new ObservableAssigneesClient(client);
            Events = new ObservableIssuesEventsClient(client);
            Labels = new ObservableIssuesLabelsClient(client);
            Milestone = new ObservableMilestonesClient(client);
            Comment = new ObservableIssueCommentsClient(client);
            Timeline = new ObservableIssueTimelineClient(client);
        }
        public GitHubIssuesWriter(Settings settings)
        {
            _settings = settings;

            var client = new GitHubClient(new ProductHeaderValue(_settings.GitHubApiProductHeaderValue))
            {
                Credentials = new Credentials(_settings.GitHubApiAccessToken)
            };

            _issuesClient = client.Issue;

            Logger = LogManager.GetLogger(this.GetType());
        }
Beispiel #22
0
        public ObservableIssuesClient(IGitHubClient client)
        {
            Ensure.ArgumentNotNull(client, "client");

            _client     = client.Issue;
            _connection = client.Connection;
            Assignee    = new ObservableAssigneesClient(client);
            Events      = new ObservableIssuesEventsClient(client);
            Labels      = new ObservableIssuesLabelsClient(client);
            Milestone   = new ObservableMilestonesClient(client);
            Comment     = new ObservableIssueCommentsClient(client);
            Timeline    = new ObservableIssueTimelineClient(client);
        }
        public GitHubIssueTrackerTests()
        {
            _log = Substitute.For<ILog>();
            _gitHubClient = Substitute.For<IGitHubClient>();
            _issuesClient = Substitute.For<IIssuesClient>();
            _gitHubClient.Issue.Returns(_issuesClient);
            _arguments = new GitReleaseNotesArguments
            {
                Repo = "Org/Repo",
                Token = "213"
            };
            _repo = Substitute.For<IRepository>();
            _repo.Network.Returns(new NetworkEx());

            _sut = new GitHubIssueTracker(_repo, () => _gitHubClient, _log, _arguments);
        }
        public GitHubIssueTrackerTests()
        {
            log          = Substitute.For <ILog>();
            gitHubClient = Substitute.For <IGitHubClient>();
            issuesClient = Substitute.For <IIssuesClient>();
            gitHubClient.Issue.Returns(issuesClient);
            arguments = new GitReleaseNotesArguments
            {
                Repo  = "Org/Repo",
                Token = "213"
            };
            repo = Substitute.For <IRepository>();
            repo.Network.Returns(new NetworkEx());

            sut = new GitHubIssueTracker(repo, () => gitHubClient, log, arguments);
        }
        public GitHubIssueTrackerTests()
        {
            gitHubClient = Substitute.For<IGitHubClient>();
            issuesClient = Substitute.For<IIssuesClient>();
            gitHubClient.Issue.Returns(issuesClient);
            arguments = new GitReleaseNotesArguments
            {
                Repo = "Org/Repo",
                Token = "213"
            };

            var context = arguments.ToContext();

            repo = Substitute.For<IRepository>();
            repo.Network.Returns(new NetworkEx());

            sut = new GitHubIssueTracker(repo, () => gitHubClient, context);
        }
        public GitHubIssueTrackerTests()
        {
            gitHubClient = Substitute.For <IGitHubClient>();
            issuesClient = Substitute.For <IIssuesClient>();
            gitHubClient.Issue.Returns(issuesClient);
            arguments = new GitReleaseNotesArguments
            {
                IssueTracker          = IssueTracker.GitHub,
                IssueTrackerProjectId = "Org/Repo",
                IssueTrackerToken     = "213"
            };

            var context = arguments.ToContext();

            repo = Substitute.For <IRepository>();
            repo.Network.Returns(new NetworkEx());

            sut = new GitHubIssueTracker(repo, () => gitHubClient, context);
        }
        public void Setup()
        {
            var logger = Substitute.For <ILogger <GitHubReporter> >();

            _mockClient       = Substitute.For <IGitHubClient>();
            _mockIssuesClient = Substitute.For <IIssuesClient>();
            _mockClient.Issue.Returns(_mockIssuesClient);
            _mockUsersClient = Substitute.For <IUsersClient>();
            _mockClient.User.Returns(_mockUsersClient);
            _mockRepositoryClient = Substitute.For <IRepositoriesClient>();
            _mockClient.Repository.Returns(_mockRepositoryClient);

            var user = new User(null, null, null, 0, null, DateTime.UtcNow, DateTime.UtcNow, 0, null, 0, 0, false, null, 0, 0, null, "LOGIN", null, null, 0, null, 0, 0, 0, null, new RepositoryPermissions(), false, null, null);

            _mockUsersClient.Current().Returns(Task.FromResult(user));

            _mockRepositoryClient.Get(Arg.Any <string>(), Arg.Any <string>()).Returns((args) => Task.FromResult(CreateRepository((string)args[0], (string)args[1], true, false)));

            _reporter = new GitHubReporter(logger, _mockClient, _config);
        }
        public TheDeleteMethod()
        {
            var gitHubClient = Helper.GetAuthenticatedClient();

            var repoName = Helper.MakeNameWithTimestamp("public-repo");

            _context = gitHubClient.CreateRepositoryContext(new NewRepository(repoName)).Result;

            _issuesClient = gitHubClient.Issue;
            _issueCommentsClient = gitHubClient.Issue.Comment;
        }
Beispiel #29
0
 public GitHubIssueRepository(ISearchClient searchClient, IIssuesClient issuesClient)
 {
     this.searchClient = searchClient;
     this.issuesClient = issuesClient;
 }
Beispiel #30
0
        public async Task LoadIssue(IIssuesClient client)
        {
            var issue = await client.Get(this.Owner, this.Repo, int.Parse(this.Number));

            this.Issue = issue;
        }
Beispiel #31
0
 public GitHubIssueCreator(IIssuesClient issuesClient, GitHubRepoInfo gitHubRepoInfo)
 {
     _issuesClient   = issuesClient;
     _gitHubRepoInfo = gitHubRepoInfo;
 }
 public static IObservable <Issue[]> LastMilestoneIssues(this IIssuesClient issuesClient, (Repository repo1, Repository repo2) repoTuple, string millestone = null)