public void RequestsCorrectUrlWithRepositoryId() { var githubClient = Substitute.For <IGitHubClient>(); var client = new ObservableCommitCommentReactionsClient(githubClient); var newReaction = new NewReaction(ReactionType.Confused); client.Create(1, 1, newReaction); githubClient.Received().Reaction.CommitComment.Create(1, 1, newReaction); }
public void EnsuresNotNullArguments() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableCommitCommentReactionsClient(gitHubClient); Assert.Throws <ArgumentNullException>(() => client.Create(null, "name", 1, new NewReaction(ReactionType.Heart))); Assert.Throws <ArgumentNullException>(() => client.Create("owner", null, 1, new NewReaction(ReactionType.Heart))); Assert.Throws <ArgumentNullException>(() => client.Create("owner", "name", 1, null)); Assert.Throws <ArgumentNullException>(() => client.Create(1, 1, null)); Assert.Throws <ArgumentException>(() => client.Create("", "name", 1, new NewReaction(ReactionType.Heart))); Assert.Throws <ArgumentException>(() => client.Create("owner", "", 1, new NewReaction(ReactionType.Heart))); }