Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added readonly to fields that are never modified #2759

Merged
merged 3 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Octokit.Reactive
/// </remarks>
public class ObservableGitHubAppInstallationsClient : IObservableGitHubAppInstallationsClient
{
private IGitHubAppInstallationsClient _client;
private readonly IGitHubAppInstallationsClient _client;
private readonly IConnection _connection;

public ObservableGitHubAppInstallationsClient(IGitHubClient client)
Expand Down
2 changes: 1 addition & 1 deletion Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Octokit.Reactive
/// </remarks>
public class ObservableGitHubAppsClient : IObservableGitHubAppsClient
{
private IGitHubAppsClient _client;
private readonly IGitHubAppsClient _client;
private readonly IConnection _connection;

public ObservableGitHubAppsClient(IGitHubClient client)
Expand Down
4 changes: 2 additions & 2 deletions Octokit.Reactive/ObservableCodespacesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
24 changes: 12 additions & 12 deletions Octokit.Tests.Integration/Clients/CheckRunsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public class CheckRunsClientTests
{
public class TheCreateMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheCreateMethod()
{
Expand Down Expand Up @@ -68,8 +68,8 @@ public async Task CreatesCheckRunWithRepositoryId()

public class TheUpdateMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheUpdateMethod()
{
Expand Down Expand Up @@ -146,8 +146,8 @@ public async Task UpdatesCheckRunWithRepositoryId()

public class TheGetAllForReferenceMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheGetAllForReferenceMethod()
{
Expand Down Expand Up @@ -230,8 +230,8 @@ public async Task GetsAllCheckRunsWithRepositoryId()

public class TheGetAllForCheckSuiteMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheGetAllForCheckSuiteMethod()
{
Expand Down Expand Up @@ -315,8 +315,8 @@ public async Task GetsAllCheckRunsWithRepositoryId()

public class TheGetMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheGetMethod()
{
Expand Down Expand Up @@ -383,8 +383,8 @@ public async Task GetsCheckRunWithRepositoryId()

public class TheGetAllAnnotationsMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheGetAllAnnotationsMethod()
{
Expand Down
20 changes: 10 additions & 10 deletions Octokit.Tests.Integration/Clients/CheckSuitesClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class CheckSuitesClientTests
{
public class TheGetMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheGetMethod()
{
Expand Down Expand Up @@ -59,8 +59,8 @@ public async Task GetsCheckSuiteWithRepositoryId()

public class TheGetAllForReferenceMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheGetAllForReferenceMethod()
{
Expand Down Expand Up @@ -107,8 +107,8 @@ public async Task GetsAllCheckSuitesWithRepositoryId()

public class TheUpdatePreferencesMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheUpdatePreferencesMethod()
{
Expand Down Expand Up @@ -155,8 +155,8 @@ public async Task UpdatesPreferencesWithRepositoryId()

public class TheCreateMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheCreateMethod()
{
Expand Down Expand Up @@ -215,8 +215,8 @@ public async Task CreatesCheckSuiteWithRepositoryId()

public class TheRerequestMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheRerequestMethod()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class GitHubAppInstallationsClientTests
{
public class TheGetAllRepositoriesForCurrentMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheGetAllRepositoriesForCurrentMethod()
{
Expand All @@ -28,7 +28,7 @@ public async Task GetsAllRepositories()

public class TheGetAllRepositoriesForCurrentUserMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheGetAllRepositoriesForCurrentUserMethod()
{
Expand Down
20 changes: 10 additions & 10 deletions Octokit.Tests.Integration/Clients/GitHubAppsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class GitHubAppsClientTests
{
public class TheGetMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheGetMethod()
{
Expand All @@ -31,7 +31,7 @@ public async Task GetsApp()

public class TheGetCurrentMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheGetCurrentMethod()
{
Expand All @@ -53,7 +53,7 @@ public async Task GetsCurrentApp()

public class TheGetAllInstallationsForCurrentMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheGetAllInstallationsForCurrentMethod()
{
Expand All @@ -80,7 +80,7 @@ public async Task GetsAllInstallations()

public class TheGetInstallationForCurrentMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheGetInstallationForCurrentMethod()
{
Expand Down Expand Up @@ -109,7 +109,7 @@ public async Task GetsInstallation()

public class TheGetAllInstallationsForCurrentUserMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheGetAllInstallationsForCurrentUserMethod()
{
Expand All @@ -130,7 +130,7 @@ public async Task GetsAllInstallationsForCurrentUser()

public class TheCreateInstallationTokenMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheCreateInstallationTokenMethod()
{
Expand All @@ -154,7 +154,7 @@ public async Task CreatesInstallationToken()

public class TheGetOrganizationInstallationForCurrentMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheGetOrganizationInstallationForCurrentMethod()
{
Expand All @@ -173,8 +173,8 @@ public async Task GetsOrganizationInstallations()

public class TheGetRepositoryInstallationForCurrentMethod
{
IGitHubClient _github;
IGitHubClient _githubAppInstallation;
readonly IGitHubClient _github;
readonly IGitHubClient _githubAppInstallation;

public TheGetRepositoryInstallationForCurrentMethod()
{
Expand Down Expand Up @@ -214,7 +214,7 @@ public async Task GetsRepositoryInstallationsWithRepositoryId()

public class TheGetUserInstallationForCurrentMethod
{
IGitHubClient _github;
readonly IGitHubClient _github;

public TheGetUserInstallationForCurrentMethod()
{
Expand Down
4 changes: 2 additions & 2 deletions Octokit.Tests.Integration/Clients/MigrationsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
public class MigrationsClientTests : IDisposable
{
private readonly IGitHubClient _gitHub;
private List<RepositoryContext> _repos;
private readonly List<RepositoryContext> _repos;
private Migration _migrationContext;
private string _orgName;
private readonly string _orgName;
private bool isExported = false;

public MigrationsClientTests()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -296,7 +296,7 @@ public async Task ReturnsNoFailedInvitations()

public class TheGetAllOrganizationMembershipsForCurrentMethod
{
private IGitHubClient _gitHub;
private readonly IGitHubClient _gitHub;

public TheGetAllOrganizationMembershipsForCurrentMethod()
{
Expand Down
24 changes: 12 additions & 12 deletions Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class ProjectCardsClientTests
{
public class TheGetAllMethod : IDisposable
{
IGitHubClient _github;
RepositoryContext _context;
readonly IGitHubClient _github;
readonly RepositoryContext _context;

public TheGetAllMethod()
{
Expand Down Expand Up @@ -164,8 +164,8 @@ public void Dispose()

public class TheGetMethod : IDisposable
{
IGitHubClient _github;
RepositoryContext _context;
readonly IGitHubClient _github;
readonly RepositoryContext _context;

public TheGetMethod()
{
Expand Down Expand Up @@ -196,8 +196,8 @@ public void Dispose()

public class TheCreateMethod : IDisposable
{
IGitHubClient _github;
RepositoryContext _context;
readonly IGitHubClient _github;
readonly RepositoryContext _context;

public TheCreateMethod()
{
Expand Down Expand Up @@ -252,8 +252,8 @@ public void Dispose()

public class TheUpdateMethod : IDisposable
{
IGitHubClient _github;
RepositoryContext _context;
readonly IGitHubClient _github;
readonly RepositoryContext _context;

public TheUpdateMethod()
{
Expand Down Expand Up @@ -325,8 +325,8 @@ public void Dispose()

public class TheDeleteMethod : IDisposable
{
IGitHubClient _github;
RepositoryContext _context;
readonly IGitHubClient _github;
readonly RepositoryContext _context;

public TheDeleteMethod()
{
Expand Down Expand Up @@ -357,8 +357,8 @@ public void Dispose()

public class TheMoveMethod : IDisposable
{
IGitHubClient _github;
RepositoryContext _context;
readonly IGitHubClient _github;
readonly RepositoryContext _context;

public TheMoveMethod()
{
Expand Down
Loading