public async Task EnsuresArgumentsNotNull() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableEventsClient(gitHubClient); await AssertEx.Throws <ArgumentNullException>(async() => await client.GetForAnOrganization(null, "org")); await AssertEx.Throws <ArgumentException>(async() => await client.GetForAnOrganization("", "org")); await AssertEx.Throws <ArgumentNullException>(async() => await client.GetForAnOrganization("fake", null)); await AssertEx.Throws <ArgumentException>(async() => await client.GetForAnOrganization("fake", "")); }
public void RequestsCorrectUrl() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableEventsClient(gitHubClient); client.GetForAnOrganization("fake", "org"); gitHubClient.Connection.Received(1).Get <List <Activity> >(new Uri("users/fake/events/orgs/org", UriKind.Relative), null, null); }