public void EnsuresNonNullArguments() { var client = new ObservableRepositoryTrafficClient(Substitute.For<IGitHubClient>()); Assert.Throws<ArgumentNullException>(() => client.GetPaths(null, "name")); Assert.Throws<ArgumentNullException>(() => client.GetPaths("owner", null)); Assert.Throws<ArgumentException>(() => client.GetPaths("", "name")); Assert.Throws<ArgumentException>(() => client.GetPaths("owner", "")); }
public void RequestsCorrectUrlWithRepositoryId() { var gitHubClient = Substitute.For<IGitHubClient>(); var client = new ObservableRepositoryTrafficClient(gitHubClient); client.GetPaths(1); gitHubClient.Received().Repository.Traffic.GetPaths(1); }