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