From ad49ba0a2cf5979975071c59f64fe26bb1a2fd3c Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Sun, 24 Feb 2019 13:38:36 +1000 Subject: [PATCH] Fix the broken tests --- .../Clients/IObservableMigrationsClient.cs | 4 ++-- .../Clients/ObservableMigrationsClient.cs | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableMigrationsClient.cs b/Octokit.Reactive/Clients/IObservableMigrationsClient.cs index 263950980c..f95c7861bd 100644 --- a/Octokit.Reactive/Clients/IObservableMigrationsClient.cs +++ b/Octokit.Reactive/Clients/IObservableMigrationsClient.cs @@ -36,7 +36,7 @@ IObservable Start( /// /// The organization of which to list migrations. /// List of most recent s. - IObservable> GetAll( + IObservable GetAll( string org); /// @@ -48,7 +48,7 @@ IObservable> GetAll( /// The organization of which to list migrations. /// Options for changing the API response /// List of most recent s. - IObservable> GetAll( + IObservable GetAll( string org, ApiOptions options); diff --git a/Octokit.Reactive/Clients/ObservableMigrationsClient.cs b/Octokit.Reactive/Clients/ObservableMigrationsClient.cs index fde1f0ea1b..36dd3dccb5 100644 --- a/Octokit.Reactive/Clients/ObservableMigrationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableMigrationsClient.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Reactive; using System.Reactive.Threading.Tasks; +using Octokit.Reactive.Internal; namespace Octokit.Reactive { @@ -15,6 +16,7 @@ namespace Octokit.Reactive public class ObservableMigrationsClient : IObservableMigrationsClient { private readonly IMigrationsClient _client; + private readonly IConnection _connection; /// /// Instantiates a GitHub Migrations API client. @@ -25,6 +27,7 @@ public ObservableMigrationsClient(IGitHubClient client) Ensure.ArgumentNotNull(client, nameof(client)); _client = client.Migration.Migrations; + _connection = client.Connection; } /// @@ -50,14 +53,16 @@ public IObservable Start(string org, StartMigrationRequest migration) /// /// The organization of which to list migrations. /// List of most recent s. - public IObservable> GetAll(string org) + public IObservable GetAll(string org) { return GetAll(org, ApiOptions.None); } - public IObservable> GetAll(string org, ApiOptions options) + public IObservable GetAll(string org, ApiOptions options) { - return _client.GetAll(org, options).ToObservable(); + Ensure.ArgumentNotNull(options, nameof(options)); + + return _connection.GetAndFlattenAllPages(ApiUrls.EnterpriseMigrations(org), options); } ///