public void EnsuresArgumentsNotNull()
        {
            var gitHubClient = Substitute.For <IGitHubClient>();
            var client       = new ObservableIssuesClient(gitHubClient);

            Assert.Throws <ArgumentNullException>(() => client.Update(null, "name", 42, new IssueUpdate()));
            Assert.Throws <ArgumentException>(() => client.Update("", "name", 42, new IssueUpdate()));
            Assert.Throws <ArgumentNullException>(() => client.Update("owner", null, 42, new IssueUpdate()));
            Assert.Throws <ArgumentException>(() => client.Update("owner", "", 42, new IssueUpdate()));
            Assert.Throws <ArgumentNullException>(() => client.Update("owner", "name", 42, null));
        }
예제 #2
0
    public async Task CanCreateAndUpdateIssues()
    {
        var newIssue = new NewIssue("Integration test issue");

        var createResult = await _client.Create(_createdRepository.Owner.Login, _repoName, newIssue);

        var updateResult = await _client.Update(_createdRepository.Owner.Login, _repoName, createResult.Number, new IssueUpdate { Title = "Modified integration test issue" });

        Assert.Equal("Modified integration test issue", updateResult.Title);
    }
        public void UpdatesClientIssueIssue()
        {
            var issueUpdate  = new IssueUpdate();
            var gitHubClient = Substitute.For <IGitHubClient>();
            var client       = new ObservableIssuesClient(gitHubClient);

            client.Update("fake", "repo", 42, issueUpdate);

            gitHubClient.Issue.Received().Update("fake", "repo", 42, issueUpdate);
        }
        public void UpdatesClientIssueIssueWithRepositoryId()
        {
            var issueUpdate  = new IssueUpdate();
            var gitHubClient = Substitute.For <IGitHubClient>();
            var client       = new ObservableIssuesClient(gitHubClient);

            client.Update(1, 42, issueUpdate);

            gitHubClient.Issue.Received().Update(1, 42, issueUpdate);
        }