public async Task EnsuresNonNullArguments() { var connection = Substitute.For<IApiConnection>(); var client = new PullRequestReviewCommentReactionsClient(connection); await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null, "name", 1)); await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll("owner", null, 1)); await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("", "name", 1)); await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll("owner", "", 1)); }
public async Task EnsuresNonNullArguments() { var connection = Substitute.For <IApiConnection>(); var client = new PullRequestReviewCommentReactionsClient(connection); await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAll(null, "name", 1)); await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAll("owner", null, 1)); await Assert.ThrowsAsync <ArgumentException>(() => client.GetAll("", "name", 1)); await Assert.ThrowsAsync <ArgumentException>(() => client.GetAll("owner", "", 1)); }
public async Task EnsuresNonNullArgumentsWithRepositoryId() { var connection = Substitute.For <IApiConnection>(); var client = new PullRequestReviewCommentReactionsClient(connection); await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAll(1, 1, null)); }
public async Task RequestsCorrectUrlWithRepositoryId() { var connection = Substitute.For <IApiConnection>(); var client = new PullRequestReviewCommentReactionsClient(connection); await client.GetAll(1, 42); connection.Received().GetAll <Reaction>(Arg.Is <Uri>(u => u.ToString() == "repositories/1/pulls/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview", Args.ApiOptions); }
public async Task RequestsCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new PullRequestReviewCommentReactionsClient(connection); await client.GetAll("fake", "repo", 42); connection.Received().GetAll <Reaction>(Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/pulls/comments/42/reactions"), "application/vnd.github.squirrel-girl-preview"); }
public async Task RequestsCorrectUrlWithRepositoryId() { var connection = Substitute.For<IApiConnection>(); var client = new PullRequestReviewCommentReactionsClient(connection); await client.GetAll(1, 42); connection.Received().GetAll<Reaction>(Arg.Is<Uri>(u => u.ToString() == "repositories/1/pulls/comments/42/reactions"), "application/vnd.github.squirrel-girl-preview"); }
public async Task RequestsCorrectUrlApiOptions() { var connection = Substitute.For <IApiConnection>(); var client = new PullRequestReviewCommentReactionsClient(connection); var options = new ApiOptions { PageCount = 1, StartPage = 1 }; await client.GetAll("fake", "repo", 42, options); connection.Received().GetAll <Reaction>(Arg.Is <Uri>(u => u.ToString() == "repos/fake/repo/pulls/comments/42/reactions"), null, "application/vnd.github.squirrel-girl-preview+json", options); }