public async Task EnsuresArguments() { var client = new ObservableStarredClient(Substitute.For<IGitHubClient>()); await AssertEx.Throws<ArgumentException>(async () => await client.CheckStarred(null, "james")); await AssertEx.Throws<ArgumentException>(async () => await client.CheckStarred("james", null)); }
public async Task ChecksStarredForUser() { var gitHubClient = Substitute.For<IGitHubClient>(); var client = new ObservableStarredClient(gitHubClient); client.CheckStarred("jugglingnutcase", "katiejamie"); gitHubClient.Activity.Starring.Received().CheckStarred("jugglingnutcase", "katiejamie"); }
public async Task EnsuresArguments() { var client = new ObservableStarredClient(Substitute.For<IGitHubClient>()); await Assert.ThrowsAsync<ArgumentNullException>(() => client.CheckStarred(null, "james").ToTask()); await Assert.ThrowsAsync<ArgumentNullException>(() => client.CheckStarred("james", null).ToTask()); }