diff --git a/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs b/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs index 531aa23aa8..2c575c69a6 100644 --- a/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs +++ b/Octokit.Reactive/Clients/ObservableGitHubAppInstallationsClient.cs @@ -11,7 +11,7 @@ namespace Octokit.Reactive /// public class ObservableGitHubAppInstallationsClient : IObservableGitHubAppInstallationsClient { - private IGitHubAppInstallationsClient _client; + private readonly IGitHubAppInstallationsClient _client; private readonly IConnection _connection; public ObservableGitHubAppInstallationsClient(IGitHubClient client) diff --git a/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs b/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs index c3baf089ec..8179baa5de 100644 --- a/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs +++ b/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs @@ -12,7 +12,7 @@ namespace Octokit.Reactive /// public class ObservableGitHubAppsClient : IObservableGitHubAppsClient { - private IGitHubAppsClient _client; + private readonly IGitHubAppsClient _client; private readonly IConnection _connection; public ObservableGitHubAppsClient(IGitHubClient client) diff --git a/Octokit.Reactive/ObservableCodespacesClient.cs b/Octokit.Reactive/ObservableCodespacesClient.cs index 74ce55a872..b8c6575346 100644 --- a/Octokit.Reactive/ObservableCodespacesClient.cs +++ b/Octokit.Reactive/ObservableCodespacesClient.cs @@ -5,8 +5,8 @@ namespace Octokit.Reactive { public class ObservableCodespacesClient : IObservableCodespacesClient { - private ICodespacesClient _client; - private IConnection _connection; + private readonly ICodespacesClient _client; + private readonly IConnection _connection; public ObservableCodespacesClient(IGitHubClient githubClient) { diff --git a/Octokit.Tests.Integration/Clients/CheckRunsClientTests.cs b/Octokit.Tests.Integration/Clients/CheckRunsClientTests.cs index cd10169931..5794088d5e 100644 --- a/Octokit.Tests.Integration/Clients/CheckRunsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/CheckRunsClientTests.cs @@ -10,8 +10,8 @@ public class CheckRunsClientTests { public class TheCreateMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheCreateMethod() { @@ -68,8 +68,8 @@ public async Task CreatesCheckRunWithRepositoryId() public class TheUpdateMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheUpdateMethod() { @@ -146,8 +146,8 @@ public async Task UpdatesCheckRunWithRepositoryId() public class TheGetAllForReferenceMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheGetAllForReferenceMethod() { @@ -230,8 +230,8 @@ public async Task GetsAllCheckRunsWithRepositoryId() public class TheGetAllForCheckSuiteMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheGetAllForCheckSuiteMethod() { @@ -315,8 +315,8 @@ public async Task GetsAllCheckRunsWithRepositoryId() public class TheGetMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheGetMethod() { @@ -383,8 +383,8 @@ public async Task GetsCheckRunWithRepositoryId() public class TheGetAllAnnotationsMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheGetAllAnnotationsMethod() { diff --git a/Octokit.Tests.Integration/Clients/CheckSuitesClientTests.cs b/Octokit.Tests.Integration/Clients/CheckSuitesClientTests.cs index 03be9d99cf..cfdbb9e9e0 100644 --- a/Octokit.Tests.Integration/Clients/CheckSuitesClientTests.cs +++ b/Octokit.Tests.Integration/Clients/CheckSuitesClientTests.cs @@ -9,8 +9,8 @@ public class CheckSuitesClientTests { public class TheGetMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheGetMethod() { @@ -59,8 +59,8 @@ public async Task GetsCheckSuiteWithRepositoryId() public class TheGetAllForReferenceMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheGetAllForReferenceMethod() { @@ -107,8 +107,8 @@ public async Task GetsAllCheckSuitesWithRepositoryId() public class TheUpdatePreferencesMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheUpdatePreferencesMethod() { @@ -155,8 +155,8 @@ public async Task UpdatesPreferencesWithRepositoryId() public class TheCreateMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheCreateMethod() { @@ -215,8 +215,8 @@ public async Task CreatesCheckSuiteWithRepositoryId() public class TheRerequestMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheRerequestMethod() { diff --git a/Octokit.Tests.Integration/Clients/GitHubAppInstallationsClientTests.cs b/Octokit.Tests.Integration/Clients/GitHubAppInstallationsClientTests.cs index 7260bc3786..7039536e93 100644 --- a/Octokit.Tests.Integration/Clients/GitHubAppInstallationsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/GitHubAppInstallationsClientTests.cs @@ -8,7 +8,7 @@ public class GitHubAppInstallationsClientTests { public class TheGetAllRepositoriesForCurrentMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetAllRepositoriesForCurrentMethod() { @@ -28,7 +28,7 @@ public async Task GetsAllRepositories() public class TheGetAllRepositoriesForCurrentUserMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetAllRepositoriesForCurrentUserMethod() { diff --git a/Octokit.Tests.Integration/Clients/GitHubAppsClientTests.cs b/Octokit.Tests.Integration/Clients/GitHubAppsClientTests.cs index 7a26b714b1..e5f97e77ef 100644 --- a/Octokit.Tests.Integration/Clients/GitHubAppsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/GitHubAppsClientTests.cs @@ -9,7 +9,7 @@ public class GitHubAppsClientTests { public class TheGetMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetMethod() { @@ -31,7 +31,7 @@ public async Task GetsApp() public class TheGetCurrentMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetCurrentMethod() { @@ -53,7 +53,7 @@ public async Task GetsCurrentApp() public class TheGetAllInstallationsForCurrentMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetAllInstallationsForCurrentMethod() { @@ -80,7 +80,7 @@ public async Task GetsAllInstallations() public class TheGetInstallationForCurrentMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetInstallationForCurrentMethod() { @@ -109,7 +109,7 @@ public async Task GetsInstallation() public class TheGetAllInstallationsForCurrentUserMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetAllInstallationsForCurrentUserMethod() { @@ -130,7 +130,7 @@ public async Task GetsAllInstallationsForCurrentUser() public class TheCreateInstallationTokenMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheCreateInstallationTokenMethod() { @@ -154,7 +154,7 @@ public async Task CreatesInstallationToken() public class TheGetOrganizationInstallationForCurrentMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetOrganizationInstallationForCurrentMethod() { @@ -173,8 +173,8 @@ public async Task GetsOrganizationInstallations() public class TheGetRepositoryInstallationForCurrentMethod { - IGitHubClient _github; - IGitHubClient _githubAppInstallation; + readonly IGitHubClient _github; + readonly IGitHubClient _githubAppInstallation; public TheGetRepositoryInstallationForCurrentMethod() { @@ -214,7 +214,7 @@ public async Task GetsRepositoryInstallationsWithRepositoryId() public class TheGetUserInstallationForCurrentMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetUserInstallationForCurrentMethod() { diff --git a/Octokit.Tests.Integration/Clients/MigrationsClientTests.cs b/Octokit.Tests.Integration/Clients/MigrationsClientTests.cs index 8b868d2c00..4e6298c919 100644 --- a/Octokit.Tests.Integration/Clients/MigrationsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/MigrationsClientTests.cs @@ -11,9 +11,9 @@ public class MigrationsClientTests : IDisposable { private readonly IGitHubClient _gitHub; - private List _repos; + private readonly List _repos; private Migration _migrationContext; - private string _orgName; + private readonly string _orgName; private bool isExported = false; public MigrationsClientTests() diff --git a/Octokit.Tests.Integration/Clients/OrganizationMembersClientTests.cs b/Octokit.Tests.Integration/Clients/OrganizationMembersClientTests.cs index 16f0f8cf5d..d1fcb7f2c9 100644 --- a/Octokit.Tests.Integration/Clients/OrganizationMembersClientTests.cs +++ b/Octokit.Tests.Integration/Clients/OrganizationMembersClientTests.cs @@ -9,8 +9,8 @@ public class OrganizationMembersClientTests { public class TheGetAllMethod { - private IGitHubClient _gitHub; - private string _organizationFixture; + private readonly IGitHubClient _gitHub; + private readonly string _organizationFixture; public TheGetAllMethod() { @@ -296,7 +296,7 @@ public async Task ReturnsNoFailedInvitations() public class TheGetAllOrganizationMembershipsForCurrentMethod { - private IGitHubClient _gitHub; + private readonly IGitHubClient _gitHub; public TheGetAllOrganizationMembershipsForCurrentMethod() { diff --git a/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs b/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs index 97568ead56..8607eb068f 100644 --- a/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs @@ -9,8 +9,8 @@ public class ProjectCardsClientTests { public class TheGetAllMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheGetAllMethod() { @@ -164,8 +164,8 @@ public void Dispose() public class TheGetMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheGetMethod() { @@ -196,8 +196,8 @@ public void Dispose() public class TheCreateMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheCreateMethod() { @@ -252,8 +252,8 @@ public void Dispose() public class TheUpdateMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheUpdateMethod() { @@ -325,8 +325,8 @@ public void Dispose() public class TheDeleteMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheDeleteMethod() { @@ -357,8 +357,8 @@ public void Dispose() public class TheMoveMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheMoveMethod() { diff --git a/Octokit.Tests.Integration/Clients/ProjectColumnsClientTests.cs b/Octokit.Tests.Integration/Clients/ProjectColumnsClientTests.cs index a8bfe67da1..c7843d797f 100644 --- a/Octokit.Tests.Integration/Clients/ProjectColumnsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/ProjectColumnsClientTests.cs @@ -11,8 +11,8 @@ public class ProjectColumnsClientTests { public class TheGetAllColumnsMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheGetAllColumnsMethod() { @@ -111,8 +111,8 @@ public void Dispose() public class TheGetColumnMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheGetColumnMethod() { @@ -142,8 +142,8 @@ public void Dispose() public class TheCreateColumnMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheCreateColumnMethod() { @@ -171,8 +171,8 @@ public void Dispose() public class TheUpdateColumnMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheUpdateColumnMethod() { @@ -205,8 +205,8 @@ public void Dispose() public class TheDeleteColumnMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheDeleteColumnMethod() { @@ -236,8 +236,8 @@ public void Dispose() public class TheMoveColumnMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheMoveColumnMethod() { diff --git a/Octokit.Tests.Integration/Clients/ProjectsClientTests.cs b/Octokit.Tests.Integration/Clients/ProjectsClientTests.cs index 1f20a2abe9..4d82149e3c 100644 --- a/Octokit.Tests.Integration/Clients/ProjectsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/ProjectsClientTests.cs @@ -11,8 +11,8 @@ public class ProjectsClientTests { public class TheGetAllForRepositoryMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheGetAllForRepositoryMethod() { @@ -213,7 +213,7 @@ public void Dispose() public class TheGetAllForOrganizationMethod { - IGitHubClient _github; + readonly IGitHubClient _github; public TheGetAllForOrganizationMethod() { @@ -286,8 +286,8 @@ public async Task ReturnsDistinctProjectsForOrganizationBasedOnStartPage() public class TheGetMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheGetMethod() { @@ -317,8 +317,8 @@ public void Dispose() public class TheUpdateMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheUpdateMethod() { @@ -355,8 +355,8 @@ public void Dispose() public class TheDeleteMethod : IDisposable { - IGitHubClient _github; - RepositoryContext _context; + readonly IGitHubClient _github; + readonly RepositoryContext _context; public TheDeleteMethod() { diff --git a/Octokit.Tests.Integration/Helpers/EnterpriseUserContext.cs b/Octokit.Tests.Integration/Helpers/EnterpriseUserContext.cs index 177a8c6902..e2c37b4e8c 100644 --- a/Octokit.Tests.Integration/Helpers/EnterpriseUserContext.cs +++ b/Octokit.Tests.Integration/Helpers/EnterpriseUserContext.cs @@ -17,7 +17,7 @@ internal EnterpriseUserContext(IConnection connection, User user) UserEmail = user.Email; } - private IConnection _connection; + private readonly IConnection _connection; internal int UserId { get; private set; } internal string UserLogin { get; private set; } internal string UserEmail { get; private set; } diff --git a/Octokit.Tests.Integration/Helpers/GpgKeyContext.cs b/Octokit.Tests.Integration/Helpers/GpgKeyContext.cs index bb85369a4f..fd141d3ada 100644 --- a/Octokit.Tests.Integration/Helpers/GpgKeyContext.cs +++ b/Octokit.Tests.Integration/Helpers/GpgKeyContext.cs @@ -17,7 +17,7 @@ internal GpgKeyContext(IConnection connection, GpgKey key) PublicKeyData = key.PublicKey; } - private IConnection _connection; + private readonly IConnection _connection; internal int GpgKeyId { get; set; } internal string KeyId { get; set; } internal string PublicKeyData { get; set; } diff --git a/Octokit.Tests.Integration/Helpers/MaintenanceModeContext.cs b/Octokit.Tests.Integration/Helpers/MaintenanceModeContext.cs index 26c405356a..f318f8d302 100644 --- a/Octokit.Tests.Integration/Helpers/MaintenanceModeContext.cs +++ b/Octokit.Tests.Integration/Helpers/MaintenanceModeContext.cs @@ -17,7 +17,7 @@ internal MaintenanceModeContext(IConnection connection, bool enabled) EnterpriseHelper.SetMaintenanceMode(_connection, enabled); } - private IConnection _connection; + private readonly IConnection _connection; public void Dispose() { diff --git a/Octokit.Tests.Integration/Helpers/PublicKeyContext.cs b/Octokit.Tests.Integration/Helpers/PublicKeyContext.cs index bf4b2d3292..0de57597ab 100644 --- a/Octokit.Tests.Integration/Helpers/PublicKeyContext.cs +++ b/Octokit.Tests.Integration/Helpers/PublicKeyContext.cs @@ -17,7 +17,7 @@ internal PublicKeyContext(IConnection connection, PublicKey key) KeyData = key.Key; } - private IConnection _connection; + private readonly IConnection _connection; internal int KeyId { get; private set; } internal string KeyTitle { get; private set; } internal string KeyData { get; private set; } diff --git a/Octokit.Tests.Integration/Helpers/RepositoryContext.cs b/Octokit.Tests.Integration/Helpers/RepositoryContext.cs index 35f62931d2..1513e6ad5d 100644 --- a/Octokit.Tests.Integration/Helpers/RepositoryContext.cs +++ b/Octokit.Tests.Integration/Helpers/RepositoryContext.cs @@ -19,7 +19,7 @@ internal RepositoryContext(IConnection connection, Repository repo) RepositoryDefaultBranch = repo.DefaultBranch; } - private IConnection _connection; + private readonly IConnection _connection; internal long RepositoryId { get; private set; } internal string RepositoryOwner { get; private set; } internal string RepositoryName { get; private set; } diff --git a/Octokit.Tests.Integration/Helpers/TeamContext.cs b/Octokit.Tests.Integration/Helpers/TeamContext.cs index f4cc15a26b..2785b618f8 100644 --- a/Octokit.Tests.Integration/Helpers/TeamContext.cs +++ b/Octokit.Tests.Integration/Helpers/TeamContext.cs @@ -15,7 +15,7 @@ internal TeamContext(IConnection connection, Team team) Invitations = new List(); } - private IConnection _connection; + private readonly IConnection _connection; internal int TeamId { get; private set; } internal string TeamName { get; private set; } diff --git a/Octokit.Tests.Integration/Reactive/ObservableCheckRunsClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableCheckRunsClientTests.cs index dad48855c9..25f2f150aa 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableCheckRunsClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableCheckRunsClientTests.cs @@ -12,8 +12,8 @@ public class ObservableCheckRunsClientTests { public class TheCreateMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheCreateMethod() { @@ -70,8 +70,8 @@ public async Task CreatesCheckRunWithRepositoryId() public class TheUpdateMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheUpdateMethod() { @@ -148,8 +148,8 @@ public async Task UpdatesCheckRunWithRepositoryId() public class TheGetAllForReferenceMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheGetAllForReferenceMethod() { @@ -232,8 +232,8 @@ public async Task GetsAllCheckRunsWithRepositoryId() public class TheGetAllForCheckSuiteMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheGetAllForCheckSuiteMethod() { @@ -316,8 +316,8 @@ public async Task GetsAllCheckRunsWithRepositoryId() public class TheGetMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheGetMethod() { @@ -384,8 +384,8 @@ public async Task GetsCheckRunWithRepositoryId() public class TheGetAllAnnotationsMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheGetAllAnnotationsMethod() { diff --git a/Octokit.Tests.Integration/Reactive/ObservableCheckSuitesClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableCheckSuitesClientTests.cs index b9b44c28f8..b210c022fb 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableCheckSuitesClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableCheckSuitesClientTests.cs @@ -11,8 +11,8 @@ public class ObservableCheckSuitesClientTests { public class TheGetMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheGetMethod() { @@ -61,8 +61,8 @@ public async Task GetsCheckSuiteWithRepositoryId() public class TheGetAllForReferenceMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheGetAllForReferenceMethod() { @@ -109,8 +109,8 @@ public async Task GetsAllCheckSuitesWithRepositoryId() public class TheUpdatePreferencesMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheUpdatePreferencesMethod() { @@ -157,8 +157,8 @@ public async Task UpdatesPreferencesWithRepositoryId() public class TheCreateMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheCreateMethod() { @@ -217,8 +217,8 @@ public async Task CreatesCheckSuiteWithRepositoryId() public class TheRerequestMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheRerequestMethod() { diff --git a/Octokit.Tests.Integration/Reactive/ObservableGitHubAppInstallationsClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableGitHubAppInstallationsClientTests.cs index 41609fa0eb..5c0a47befa 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableGitHubAppInstallationsClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableGitHubAppInstallationsClientTests.cs @@ -10,7 +10,7 @@ public class ObservableGitHubAppInstallationsClientTests { public class TheGetAllRepositoriesForCurrentMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetAllRepositoriesForCurrentMethod() { @@ -30,7 +30,7 @@ public async Task GetsAllRepositories() public class TheGetAllRepositoriesForCurrentUserMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetAllRepositoriesForCurrentUserMethod() { diff --git a/Octokit.Tests.Integration/Reactive/ObservableGitHubAppsClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableGitHubAppsClientTests.cs index f5da91a3de..3cc2c7b30a 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableGitHubAppsClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableGitHubAppsClientTests.cs @@ -11,7 +11,7 @@ public class ObservableGitHubAppsClientTests { public class TheGetMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetMethod() { @@ -33,7 +33,7 @@ public async Task GetsApp() public class TheGetCurrentMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetCurrentMethod() { @@ -55,7 +55,7 @@ public async Task GetsCurrentApp() public class TheGetAllInstallationsForCurrentMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetAllInstallationsForCurrentMethod() { @@ -82,7 +82,7 @@ public async Task GetsAllInstallations() public class TheGetInstallationForCurrentMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetInstallationForCurrentMethod() { @@ -111,7 +111,7 @@ public async Task GetsInstallation() public class TheGetAllInstallationsForCurrentUserMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetAllInstallationsForCurrentUserMethod() { @@ -132,7 +132,7 @@ public async Task GetsAllInstallationsForCurrentUser() public class TheCreateInstallationTokenMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheCreateInstallationTokenMethod() { @@ -156,7 +156,7 @@ public async Task CreatesInstallationToken() public class TheGetOrganizationInstallationForCurrentMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetOrganizationInstallationForCurrentMethod() { @@ -175,8 +175,8 @@ public async Task GetsOrganizationInstallations() public class TheGetRepositoryInstallationForCurrentMethod { - IObservableGitHubClient _github; - IObservableGitHubClient _githubAppInstallation; + readonly IObservableGitHubClient _github; + readonly IObservableGitHubClient _githubAppInstallation; public TheGetRepositoryInstallationForCurrentMethod() { @@ -216,7 +216,7 @@ public async Task GetsRepositoryInstallationsWithRepositoryId() public class TheGetUserInstallationForCurrentMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetUserInstallationForCurrentMethod() { diff --git a/Octokit.Tests.Integration/Reactive/ObservableProjectCardsClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableProjectCardsClientTests.cs index d3f29dbaea..7eeb51957e 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableProjectCardsClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableProjectCardsClientTests.cs @@ -12,8 +12,8 @@ public class ObservableProjectCardsClientTests { public class TheGetAllMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheGetAllMethod() { @@ -167,8 +167,8 @@ public void Dispose() public class TheGetMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheGetMethod() { @@ -199,8 +199,8 @@ public void Dispose() public class TheCreateMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheCreateMethod() { @@ -240,8 +240,8 @@ public void Dispose() public class TheUpdateMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheUpdateMethod() { @@ -313,8 +313,8 @@ public void Dispose() public class TheDeleteMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheDeleteMethod() { @@ -345,8 +345,8 @@ public void Dispose() public class TheMoveMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheMoveMethod() { diff --git a/Octokit.Tests.Integration/Reactive/ObservableProjectColumnsClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableProjectColumnsClientTests.cs index fe9e5e257a..5bf5214940 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableProjectColumnsClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableProjectColumnsClientTests.cs @@ -13,8 +13,8 @@ public class ObservableProjectColumnsClientTests { public class TheGetAllColumnsMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheGetAllColumnsMethod() { @@ -113,8 +113,8 @@ public void Dispose() public class TheGetColumnMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheGetColumnMethod() { @@ -144,8 +144,8 @@ public void Dispose() public class TheCreateColumnMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheCreateColumnMethod() { @@ -173,8 +173,8 @@ public void Dispose() public class TheUpdateColumnMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheUpdateColumnMethod() { @@ -207,8 +207,8 @@ public void Dispose() public class TheDeleteColumnMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheDeleteColumnMethod() { @@ -238,8 +238,8 @@ public void Dispose() public class TheMoveColumnMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheMoveColumnMethod() { diff --git a/Octokit.Tests.Integration/Reactive/ObservableProjectsClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableProjectsClientTests.cs index c9fc202457..bdb39975d3 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableProjectsClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableProjectsClientTests.cs @@ -13,8 +13,8 @@ public class ObservableProjectsClientTests { public class TheGetAllForRepositoryMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheGetAllForRepositoryMethod() { @@ -215,7 +215,7 @@ public void Dispose() public class TheGetAllForOrganizationMethod { - IObservableGitHubClient _github; + readonly IObservableGitHubClient _github; public TheGetAllForOrganizationMethod() { @@ -288,8 +288,8 @@ public async Task ReturnsDistinctProjectsForOrganizationBasedOnStartPage() public class TheGetMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheGetMethod() { @@ -319,8 +319,8 @@ public void Dispose() public class TheUpdateMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheUpdateMethod() { @@ -357,8 +357,8 @@ public void Dispose() public class TheDeleteMethod : IDisposable { - IObservableGitHubClient _github; - RepositoryContext _context; + readonly IObservableGitHubClient _github; + readonly RepositoryContext _context; public TheDeleteMethod() { diff --git a/Octokit.Tests.Integration/Reactive/ObservableRepositoryBranchesClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableRepositoryBranchesClientTests.cs index 808a84217c..d35a4e8db7 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableRepositoryBranchesClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableRepositoryBranchesClientTests.cs @@ -10,8 +10,8 @@ public class ObservableRepositoryBranchesClientTests { public class TheGetBranchProtectionMethod { - IGitHubClient _github; - IObservableRepositoryBranchesClient _client; + readonly IGitHubClient _github; + readonly IObservableRepositoryBranchesClient _client; public TheGetBranchProtectionMethod() { @@ -116,8 +116,8 @@ public async Task GetsBranchProtectionForOrgRepoWithRepositoryId() public class TheUpdateBranchProtectionMethod { - IGitHubClient _github; - IObservableRepositoryBranchesClient _client; + readonly IGitHubClient _github; + readonly IObservableRepositoryBranchesClient _client; public TheUpdateBranchProtectionMethod() { @@ -262,8 +262,8 @@ public async Task UpdatesBranchProtectionForOrgRepoWithRepositoryId() public class TheDeleteBranchProtectionMethod { - IGitHubClient _github; - IObservableRepositoryBranchesClient _client; + readonly IGitHubClient _github; + readonly IObservableRepositoryBranchesClient _client; public TheDeleteBranchProtectionMethod() { @@ -324,8 +324,8 @@ public async Task DeletesBranchProtectionForOrgRepoWithRepositoryId() public class TheGetReviewEnforcementMethod { - IGitHubClient _github; - IObservableRepositoryBranchesClient _client; + readonly IGitHubClient _github; + readonly IObservableRepositoryBranchesClient _client; public TheGetReviewEnforcementMethod() { @@ -396,8 +396,8 @@ public async Task GetsReviewEnforcementForOrgRepoWithRepositoryId() public class TheUpdateReviewEnforcementMethod { - IGitHubClient _github; - IObservableRepositoryBranchesClient _client; + readonly IGitHubClient _github; + readonly IObservableRepositoryBranchesClient _client; public TheUpdateReviewEnforcementMethod() { @@ -530,8 +530,8 @@ public async Task UpdatesReviewEnforcementForOrgRepoWithAdminOnlyWithRepositoryI public class TheRemoveReviewEnforcementMethod { - IGitHubClient _github; - IObservableRepositoryBranchesClient _client; + readonly IGitHubClient _github; + readonly IObservableRepositoryBranchesClient _client; public TheRemoveReviewEnforcementMethod() { diff --git a/Octokit.Tests.Integration/Reactive/ObservableRepositoryDeployKeysClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableRepositoryDeployKeysClientTests.cs index 5a6ba833c6..cb0364ce58 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableRepositoryDeployKeysClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableRepositoryDeployKeysClientTests.cs @@ -10,9 +10,9 @@ public class ObservableRespositoryDeployKeysClientTests : IDisposable { const string _key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDB8IE5+RppLpeW+6lqo0fpfvMunKg6W4bhYCfVJIOYbpKoHP95nTUMZPBT++9NLeB4/YsuNTCrrpnpjc4f2IVpGvloRiVXjAzoJk9QIL6uzn1zRFdvaxSJ3Urhe9LcLHcIgccgZgSdWGzaZI3xtMvGC4diwWNsPjvVc/RyDM/MPqAim0X5XVOQwEFsSsUSraezJ+VgYMYzLYBcKWW0B86HVVhL4ZtmcY/RN2544bljnzw2M3aQvXNPTvkuiUoqLOI+5/qzZ8PfkruO55YtweEd0lkY6oZvrBPMD6dLODEqMHb4tD6htx60wSipNqjPwpOMpzp0Bk3G909unVXi6Fw5"; const string _keyTitle = "octokit@github"; - ObservableRepositoryDeployKeysClient _client; - Repository _repository; - string _owner; + readonly ObservableRepositoryDeployKeysClient _client; + readonly Repository _repository; + readonly string _owner; public ObservableRespositoryDeployKeysClientTests() { diff --git a/Octokit/Http/SimpleJsonSerializer.cs b/Octokit/Http/SimpleJsonSerializer.cs index b4bb555828..8d6d26e270 100644 --- a/Octokit/Http/SimpleJsonSerializer.cs +++ b/Octokit/Http/SimpleJsonSerializer.cs @@ -35,7 +35,7 @@ internal static object DeserializeEnum(string value, Type type) class GitHubSerializerStrategy : PocoJsonSerializerStrategy { readonly List _membersWhichShouldPublishNull = new List(); - ConcurrentDictionary> _cachedEnums = new ConcurrentDictionary>(); + readonly ConcurrentDictionary> _cachedEnums = new ConcurrentDictionary>(); protected override string MapClrMemberToJsonFieldName(MemberInfo member) { diff --git a/Octokit/Models/Request/ApiOptions.cs b/Octokit/Models/Request/ApiOptions.cs index 3dbfd1d40a..5a3cdb0163 100644 --- a/Octokit/Models/Request/ApiOptions.cs +++ b/Octokit/Models/Request/ApiOptions.cs @@ -7,7 +7,7 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class ApiOptions { - private static ApiOptions emptyOptions = new ApiOptions(); + private static readonly ApiOptions emptyOptions = new ApiOptions(); public static ApiOptions None {