public async Task EnsureNonNullArguments()
            {
                var client = new ObservableGistsClient(Substitute.For<IGitHubClient>());

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllCommits(null).ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllCommits("").ToTask());

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForks(null).ToTask());
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForks("").ToTask());
            }
            public void RequestsCorrectGetForksUrl()
            {
                var github = Substitute.For<IGitHubClient>();
                var client = new ObservableGistsClient(github);
                var expected = new Uri("gists/9257657/forks", UriKind.Relative);

                client.GetAllForks("9257657");

                github.Connection.Received(1).Get<List<GistFork>>(expected, Arg.Any<IDictionary<string, string>>(), null);
            }
            public void RequestsTheCorrectUrlWithApiOptions()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableGistsClient(gitHubClient);

                var options = new ApiOptions
                {
                    PageSize = 1,
                    PageCount = 1,
                    StartPage = 1
                };
                client.GetAllForks("id", options);

                gitHubClient.Connection.Received(1).Get<List<GistFork>>(new Uri("gists/id/forks", UriKind.Relative),
                                  DictionaryWithApiOptions, null);
            }
            public void EnsuresNonNullArguments()
            {
                var gitsClient = new ObservableGistsClient(Substitute.For<IGitHubClient>());

                Assert.Throws<ArgumentNullException>(() => gitsClient.GetAllForks(null));
                Assert.Throws<ArgumentException>(() => gitsClient.GetAllForks(""));
                Assert.Throws<ArgumentNullException>(() => gitsClient.GetAllForks("id", null));
                Assert.Throws<ArgumentException>(() => gitsClient.GetAllForks("", ApiOptions.None));

            }
            public void RequestsTheCorrectUrl()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableGistsClient(gitHubClient);

                client.GetAllForks("id");

                gitHubClient.Connection.Received(1).Get<List<GistFork>>(new Uri("gists/id/forks", UriKind.Relative), Args.EmptyDictionary, null);
            }