Exemple #1
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new ObservableIssuesLabelsClient(Substitute.For <IGitHubClient>());

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

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

                client.AddToIssue(1, 42, labels);

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