Пример #1
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new ObservableIssuesLabelsClient(Substitute.For <IGitHubClient>());

                Assert.Throws <ArgumentNullException>(() => client.ReplaceAllForIssue(null, "name", 42, labels));
                Assert.Throws <ArgumentNullException>(() => client.ReplaceAllForIssue("owner", null, 42, labels));
                Assert.Throws <ArgumentNullException>(() => client.ReplaceAllForIssue("owner", "name", 42, null));

                Assert.Throws <ArgumentException>(() => client.ReplaceAllForIssue("", "name", 42, labels));
                Assert.Throws <ArgumentException>(() => client.ReplaceAllForIssue("owner", "", 42, labels));
            }
            public void PutsToCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableIssuesLabelsClient(gitHubClient);

                client.ReplaceAllForIssue(1, 42, labels);

                gitHubClient.Issue.Labels.Received().ReplaceAllForIssue(1, 42, labels);
            }