public void EnsuresNonNullArguments() { var client = new ObservableRepositoryForksClient(Substitute.For <IGitHubClient>()); Assert.Throws <ArgumentNullException>(() => client.Create(null, "name", new NewRepositoryFork())); Assert.Throws <ArgumentNullException>(() => client.Create("owner", null, new NewRepositoryFork())); Assert.Throws <ArgumentNullException>(() => client.Create("owner", "name", null)); Assert.Throws <ArgumentException>(() => client.Create("", "name", new NewRepositoryFork())); Assert.Throws <ArgumentException>(() => client.Create("owner", "", new NewRepositoryFork())); }
public void RequestsCorrectUrl() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableRepositoryForksClient(gitHubClient); var newRepositoryFork = new NewRepositoryFork(); client.Create("fake", "repo", newRepositoryFork); gitHubClient.Received().Repository.Forks.Create("fake", "repo", newRepositoryFork); }