public void GetsFromClientIssueIssue() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableTreesClient(gitHubClient); client.Get("fake", "repo", "123456ABCD"); gitHubClient.GitDatabase.Tree.Received().Get("fake", "repo", "123456ABCD"); }
public void RequestsCorrectUrlWithRepositoryId() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableTreesClient(gitHubClient); client.Get(1, "123456ABCD"); gitHubClient.Git.Tree.Received().Get(1, "123456ABCD"); }
public async Task EnsuresNonNullArguments() { var client = new ObservableTreesClient(Substitute.For <IGitHubClient>()); Assert.Throws <ArgumentNullException>(() => client.Get(null, "name", "123456ABCD")); Assert.Throws <ArgumentNullException>(() => client.Get("owner", null, "123456ABCD")); Assert.Throws <ArgumentNullException>(() => client.Get("owner", "name", null)); Assert.Throws <ArgumentNullException>(() => client.Get(1, null)); Assert.Throws <ArgumentException>(() => client.Get("", "name", "123456ABCD")); Assert.Throws <ArgumentException>(() => client.Get("owner", "", "123456ABCD")); Assert.Throws <ArgumentException>(() => client.Get("owner", "name", "")); Assert.Throws <ArgumentException>(() => client.Get(1, "")); }