public void EnsuresNonNullArguments() { var client = new ObservableReleasesClient(Substitute.For<IGitHubClient>()); Assert.Throws<ArgumentNullException>(() => client.GetAssets(null, "name", 1)); Assert.Throws<ArgumentException>(() => client.GetAssets("", "name", 1)); Assert.Throws<ArgumentNullException>(() => client.GetAssets("owner", null, 1)); Assert.Throws<ArgumentException>(() => client.GetAssets("owner", "", 1)); }
public void RequestsTheCorrectUrl() { var gitHubClient = Substitute.For<IGitHubClient>(); var client = new ObservableReleasesClient(gitHubClient); client.GetAssets("fake", "repo", 1); gitHubClient.Connection.Received(1).Get<List<ReleaseAsset>>( new Uri("repos/fake/repo/releases/1/assets", UriKind.Relative), null, null); }