public void EnsuresNonEmptyArguments()
            {
                var githubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableRepositoryPagesClient(githubClient);

                Assert.Throws <ArgumentException>(() => client.GetAll("", "repo", new ApiOptions()));
                Assert.Throws <ArgumentException>(() => client.GetAll("owner", "", new ApiOptions()));
            }
            public void RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableRepositoryPagesClient(gitHubClient);

                client.GetAll(1);

                gitHubClient.Received().Repository.Page.GetAll(1);
            }
            public void PostsToCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableRepositoryPagesClient(gitHubClient);

                client.RequestPageBuild("fake", "repo");

                gitHubClient.Received().Repository.Page.RequestPageBuild("fake", "repo");
            }
            public void RequestsCorrectUrl()
            {
                var githubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableRepositoryPagesClient(githubClient);
                var options      = new ApiOptions();

                client.GetAll("fake", "repo", options);
                githubClient.Received().Repository.Page.GetAll("fake", "repo", options);
            }
            public void EnsuresNonNullArguments()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableRepositoryPagesClient(gitHubClient);

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

                Assert.Throws <ArgumentException>(() => client.Get("", "name"));
                Assert.Throws <ArgumentException>(() => client.Get("owner", ""));
            }
            public void RequestsCorrectUrlWithApiOptionsWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableRepositoryPagesClient(gitHubClient);

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

                client.GetAll(1, options);

                gitHubClient.Received().Repository.Page.GetAll(1, options);
            }
            public TheGetAllMethod()
            {
                var github = Helper.GetAuthenticatedClient();

                _repositoryPagesClient = new ObservableRepositoryPagesClient(github);
            }