public Create ( long repositoryId, int number, string newComment ) : IObservable |
||
repositoryId | long | The Id of the repository |
number | int | The number of the issue |
newComment | string | The text of the new comment |
Résultat | IObservable |
public void PostsToCorrectUrlWithRepositoryId() { const string newComment = "some title"; var gitHubClient = Substitute.For<IGitHubClient>(); var client = new ObservableIssueCommentsClient(gitHubClient); client.Create(1, 1, newComment); gitHubClient.Issue.Comment.Received().Create(1, 1, newComment); }
public async Task EnsuresNonNullArguments() { var gitHubClient = Substitute.For<IGitHubClient>(); var client = new ObservableIssueCommentsClient(gitHubClient); Assert.Throws<ArgumentNullException>(() => client.Create(null, "name", 1, "x")); Assert.Throws<ArgumentNullException>(() => client.Create("owner", null, 1, "x")); Assert.Throws<ArgumentNullException>(() => client.Create("owner", "name", 1, null)); Assert.Throws<ArgumentNullException>(() => client.Create(1, 1, null)); Assert.Throws<ArgumentException>(() => client.Create("", "name", 1, "x")); Assert.Throws<ArgumentException>(() => client.Create("owner", "", 1, "x")); }
public async Task EnsuresArgumentsNotNull() { var gitHubClient = Substitute.For<IGitHubClient>(); var client = new ObservableIssueCommentsClient(gitHubClient); await Assert.ThrowsAsync<ArgumentNullException>(() => client.Create(null, "name", 1, "title").ToTask()); await Assert.ThrowsAsync<ArgumentException>(() => client.Create("", "name", 1, "x").ToTask()); await Assert.ThrowsAsync<ArgumentNullException>(() => client.Create("owner", null, 1, "x").ToTask()); await Assert.ThrowsAsync<ArgumentException>(() => client.Create("owner", "", 1, "x").ToTask()); await Assert.ThrowsAsync<ArgumentNullException>(() => client.Create("owner", "name", 1, null).ToTask()); }