コード例 #1
0
            public void EnsuresNonNullArguments()
            {
                var githubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableAssigneesClient(githubClient);
                var newAssignees = new AssigneesUpdate(new List <string>()
                {
                    "assignee1", "assignee2"
                });

                Assert.Throws <ArgumentNullException>(() => client.AddAssignees(null, "name", 2, newAssignees));
                Assert.Throws <ArgumentNullException>(() => client.AddAssignees("name", null, 2, newAssignees));
                Assert.Throws <ArgumentNullException>(() => client.AddAssignees("owner", "name", 2, null));

                Assert.Throws <ArgumentException>(() => client.AddAssignees("owner", "", 2, newAssignees));
                Assert.Throws <ArgumentException>(() => client.AddAssignees("", "name", 2, newAssignees));
            }
コード例 #2
0
            public void RequestsCorrectUrl()
            {
                var newAssignees = new AssigneesUpdate(new List <string>()
                {
                    "assignee1", "assignee2"
                });
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableAssigneesClient(gitHubClient);

                client.AddAssignees("fake", "repo", 2, newAssignees);

                gitHubClient.Issue.Assignee.Received().AddAssignees("fake", "repo", 2, newAssignees);
            }