public async Task EnsuresArgumentsNotNull() { var client = new PullRequestReviewCommentsClient(Substitute.For<IApiConnection>()); await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetComment(null, "name", 1)); await Assert.ThrowsAsync<ArgumentException>(() => client.GetComment("", "name", 1)); await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetComment("owner", null, 1)); await Assert.ThrowsAsync<ArgumentException>(() => client.GetComment("owner", "", 1)); }
public void RequestsCorrectUrlWithRepositoryId() { var connection = Substitute.For<IApiConnection>(); var client = new PullRequestReviewCommentsClient(connection); client.GetComment(1, 53); connection.Received().Get<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/pulls/comments/53")); }
public void RequestsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new PullRequestReviewCommentsClient(connection); client.GetComment("fakeOwner", "fakeRepoName", 53); connection.Received().Get<PullRequestReviewComment>(Arg.Is<Uri>(u => u.ToString() == "repos/fakeOwner/fakeRepoName/pulls/comments/53")); }
public void RequestsCorrectUrl() { var connection = Substitute.For<IApiConnection>(); var client = new PullRequestReviewCommentsClient(connection); client.GetComment("owner", "name", 53); connection.Received().Get<PullRequestReviewComment>( Arg.Is<Uri>(u => u.ToString() == "repos/owner/name/pulls/comments/53"), Arg.Any<Dictionary<string, string>>(), "application/vnd.github.squirrel-girl-preview"); }