mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 03:55:55 +00:00
Refactor: Change method names to follow Octokit's conventions.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Reactive;
|
||||
|
||||
namespace Octokit.Reactive
|
||||
@@ -35,7 +36,7 @@ namespace Octokit.Reactive
|
||||
/// </remarks>
|
||||
/// <param name="org">The organization of which to list migrations.</param>
|
||||
/// <returns>List of most recent <see cref="Migration"/>s.</returns>
|
||||
IObservable<List<Migration>> GetMigrations(
|
||||
IObservable<List<Migration>> GetAll(
|
||||
string org);
|
||||
|
||||
/// <summary>
|
||||
@@ -47,7 +48,8 @@ namespace Octokit.Reactive
|
||||
/// <param name="org">The organization which is migrating.</param>
|
||||
/// <param name="id">Migration ID of the organization.</param>
|
||||
/// <returns>A <see cref="Migration"/> object representing the state of migration.</returns>
|
||||
IObservable<Migration> GetStatus(
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
|
||||
IObservable<Migration> Get(
|
||||
string org,
|
||||
int id);
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@ namespace Octokit.Reactive
|
||||
/// </remarks>
|
||||
/// <param name="org">The organization of which to list migrations.</param>
|
||||
/// <returns>List of most recent <see cref="Migration"/>s.</returns>
|
||||
public IObservable<List<Migration>> GetMigrations(string org)
|
||||
public IObservable<List<Migration>> GetAll(string org)
|
||||
{
|
||||
return _client.GetMigrations(org).ToObservable();
|
||||
return _client.GetAll(org).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -64,9 +64,9 @@ namespace Octokit.Reactive
|
||||
/// <param name="org">The organization which is migrating.</param>
|
||||
/// <param name="id">Migration ID of the organization.</param>
|
||||
/// <returns>A <see cref="Migration"/> object representing the state of migration.</returns>
|
||||
public IObservable<Migration> GetStatus(string org, int id)
|
||||
public IObservable<Migration> Get(string org, int id)
|
||||
{
|
||||
return _client.GetStatus(org, id).ToObservable();
|
||||
return _client.Get(org, id).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseMigrationsClient(connection);
|
||||
|
||||
client.GetStatus("fake", 69);
|
||||
client.Get("fake", 69);
|
||||
|
||||
connection.Received().Get<Migration>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "orgs/fake/migrations/69"));
|
||||
@@ -28,8 +28,8 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseMigrationsClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetStatus(null, 69));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetStatus("", 69));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get(null, 69));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.Get("", 69));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseMigrationsClient(connection);
|
||||
|
||||
client.GetMigrations("fake");
|
||||
client.GetAll("fake");
|
||||
|
||||
connection.Received().Get<List<Migration>>(
|
||||
Arg.Is<Uri>(u => u.ToString() == "orgs/fake/migrations"));
|
||||
@@ -53,8 +53,8 @@ namespace Octokit.Tests.Clients
|
||||
var connection = Substitute.For<IApiConnection>();
|
||||
var client = new EnterpriseMigrationsClient(connection);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetMigrations(null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetMigrations(""));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAll(null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAll(""));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace Octokit.Tests
|
||||
var github = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableEnterpriseMigrationsClient(github);
|
||||
|
||||
client.GetMigrations("fake");
|
||||
github.Enterprise.Migration.Received(1).GetMigrations("fake");
|
||||
client.GetAll("fake");
|
||||
github.Enterprise.Migration.Received(1).GetAll("fake");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ namespace Octokit.Tests
|
||||
var github = Substitute.For<IGitHubClient>();
|
||||
var client = new ObservableEnterpriseMigrationsClient(github);
|
||||
|
||||
client.GetStatus("fake", 69);
|
||||
github.Enterprise.Migration.Received(1).GetStatus("fake", 69);
|
||||
client.Get("fake", 69);
|
||||
github.Enterprise.Migration.Received(1).Get("fake", 69);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
/// <param name="org">The organization of which to list migrations.</param>
|
||||
/// <returns>List of most recent <see cref="Migration"/>s.</returns>
|
||||
public async Task<List<Migration>> GetMigrations(string org)
|
||||
public async Task<List<Migration>> GetAll(string org)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(org, "org");
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Octokit
|
||||
/// <param name="org">The organization which is migrating.</param>
|
||||
/// <param name="id">Migration ID of the organization.</param>
|
||||
/// <returns>A <see cref="Migration"/> object representing the state of migration.</returns>
|
||||
public async Task<Migration> GetStatus(string org, int id)
|
||||
public async Task<Migration> Get(string org, int id)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(org, "org");
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
@@ -34,7 +35,7 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
/// <param name="org">The organization of which to list migrations.</param>
|
||||
/// <returns>List of most recent <see cref="Migration"/>s.</returns>
|
||||
Task<List<Migration>> GetMigrations(
|
||||
Task<List<Migration>> GetAll(
|
||||
string org);
|
||||
|
||||
/// <summary>
|
||||
@@ -46,7 +47,8 @@ namespace Octokit
|
||||
/// <param name="org">The organization which is migrating.</param>
|
||||
/// <param name="id">Migration ID of the organization.</param>
|
||||
/// <returns>A <see cref="Migration"/> object representing the state of migration.</returns>
|
||||
Task<Migration> GetStatus(
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
|
||||
Task<Migration> Get(
|
||||
string org,
|
||||
int id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user