public void EnsuresNonNullArguments() { var githubClient = Substitute.For<IGitHubClient>(); var client = new ObservableRepositoryCommentsClient(githubClient); Assert.Throws<ArgumentNullException>(() => client.Update(null, "name", 42, "updated comment")); Assert.Throws<ArgumentNullException>(() => client.Update("owner", null, 42, "updated comment")); Assert.Throws<ArgumentNullException>(() => client.Update("owner", "name", 42, null)); Assert.Throws<ArgumentNullException>(() => client.Update(1, 42, null)); Assert.Throws<ArgumentException>(() => client.Update("", "name", 42, "updated comment")); Assert.Throws<ArgumentException>(() => client.Update("owner", "", 42, "updated comment")); }
public void PostsToCorrectUrlWithRepositoryId() { const string issueCommentUpdate = "updated comment"; var githubClient = Substitute.For<IGitHubClient>(); var client = new ObservableRepositoryCommentsClient(githubClient); client.Update(1, 42, issueCommentUpdate); githubClient.Repository.Comment.Received().Update(1, 42, issueCommentUpdate); }