示例#1
0
            public void EnsuresNonNullArguments()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableIssueReactionsClient(gitHubClient);

                Assert.Throws <ArgumentNullException>(() => client.GetAll(null, "name", 1));
                Assert.Throws <ArgumentNullException>(() => client.GetAll("owner", null, 1));

                Assert.Throws <ArgumentException>(() => client.GetAll("", "name", 1));
                Assert.Throws <ArgumentException>(() => client.GetAll("owner", "", 1));
            }
示例#2
0
            public void EnsuresNonNullArgumentsWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableIssueReactionsClient(gitHubClient);

                Assert.Throws <ArgumentNullException>(() => client.GetAll(1, 1, null));
            }
示例#3
0
            public void RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableIssueReactionsClient(gitHubClient);

                client.GetAll(1, 42);
                gitHubClient.Received().Reaction.Issue.GetAll(1, 42, Args.ApiOptions);
            }
示例#4
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableIssueReactionsClient(gitHubClient);

                client.GetAll("fake", "repo", 42);
                gitHubClient.Received().Reaction.Issue.GetAll("fake", "repo", 42);
            }
示例#5
0
            public void RequestsCorrectUrlWithRepositoryIdApiOptions()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableIssueReactionsClient(gitHubClient);

                var options = new ApiOptions
                {
                    PageCount = 1,
                    StartPage = 1,
                    PageSize  = 1
                };

                client.GetAll(1, 42, options);
                gitHubClient.Received().Reaction.Issue.GetAll(1, 42, options);
            }