Пример #1
0
            public async Task EnsuresArgumentsNotNull()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableIssueCommentsClient(gitHubClient);

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.Update(null, "name", 42, "title").ToTask());

                await Assert.ThrowsAsync <ArgumentException>(() => client.Update("", "name", 42, "x").ToTask());

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.Update("owner", null, 42, "x").ToTask());

                await Assert.ThrowsAsync <ArgumentException>(() => client.Update("owner", "", 42, "x").ToTask());

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.Update("owner", "name", 42, null).ToTask());
            }
Пример #2
0
            public void PostsToCorrectUrlWithRepositoryId()
            {
                const string issueCommentUpdate = "Worthwhile update";
                var          gitHubClient       = Substitute.For <IGitHubClient>();
                var          client             = new ObservableIssueCommentsClient(gitHubClient);

                client.Update(1, 42, issueCommentUpdate);

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