Skip to content

Commit 69e81d3

Browse files
authored
Convert public fields to properties (#814)
* Convert public fields to properties * Run dotnet format * Don't include fields in JSON serialization anymore * Make Runner.Online a nullable bool * Delete script
1 parent 8bf473e commit 69e81d3

File tree

125 files changed

+2230
-1502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+2230
-1502
lines changed

NGitLab.Mock.Tests/GroupsMockTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public void Test_create_update_delete_group_hooks()
349349
var groupId = 1;
350350

351351
using var server = new GitLabConfig()
352-
.WithUser("user1", isAdmin: true)
352+
.WithUser("user1", isAdmin: true)
353353
.WithGroup("group1", groupId)
354354
.BuildServer();
355355

NGitLab.Mock.Tests/UsingVerify/RepositoryMockTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
using NGitLab.Mock.Clients;
55
using NGitLab.Mock.Config;
66
using NUnit.Framework;
7+
using static VerifyNUnit.Verifier;
78
using RepositoryGetTreeOptions = NGitLab.Models.RepositoryGetTreeOptions;
89
using Throws = NUnit.Framework.Throws;
9-
using static VerifyNUnit.Verifier;
1010

1111
namespace NGitLab.Mock.Tests.UsingVerify;
1212

NGitLab.Mock/Change.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class Change : GitLabObject
2020

2121
public Models.Change ToChange()
2222
{
23-
return new ()
23+
return new()
2424
{
2525
Diff = Diff,
2626
AMode = AMode,

NGitLab.Mock/Clients/MergeRequestChangeClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace NGitLab.Mock.Clients;
55

6-
internal sealed class MergeRequestChangeClient : ClientBase, IMergeRequestChangeClient
6+
internal sealed class MergeRequestChangeClient : ClientBase, IMergeRequestChangeClient
77
{
88
private readonly long _projectId;
99
private readonly long _mergeRequestIid;

NGitLab.Mock/PipelineSchedule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public PipelineScheduleBasic ToPipelineScheduleBasicClient()
4646
public Models.PipelineSchedule ToPipelineScheduleClient()
4747
=> new()
4848
{
49-
Id = Id,
49+
Id = Id,
5050
Active = Active,
5151
CreatedAt = CreatedAt,
5252
Cron = Cron,

NGitLab.Tests/AsyncApiValidation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void ValidateAsyncMethodSignature()
3434

3535
if (parameterInfo.ParameterType != typeof(CancellationToken))
3636
{
37-
Assert.Fail($"The last parameter of method '{method}' must be of type 'CancellationToken' and named 'cancellationToken'");
37+
Assert.Fail($"The last parameter of method '{method}' must be of type 'CancellationToken' and named 'cancellationToken'");
3838
}
3939

4040
if (!string.Equals(parameterInfo.Name, "cancellationToken", StringComparison.Ordinal))

NGitLab.Tests/PipelineTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public async Task Test_can_list_jobs_from_pipeline()
8989

9090
var pipelineJobQuery = new PipelineJobQuery
9191
{
92-
PipelineId = pipeline.Id, Scope = new[] { "success", "pending" },
92+
PipelineId = pipeline.Id,
93+
Scope = new[] { "success", "pending" },
9394
};
9495
var allJobs = await GitLabTestContext.RetryUntilAsync(() => pipelineClient.GetJobsAsync(pipelineJobQuery).ToList(), p => p.Count != 0, TimeSpan.FromSeconds(120));
9596
Assert.That(allJobs.Count != 0);

NGitLab.Tests/RunnerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,6 @@ private static RetryPolicy GetRetryPolicy()
132132
{
133133
return Policy
134134
.Handle<GitLabException>(ex => ex.StatusCode is HttpStatusCode.Forbidden)
135-
.WaitAndRetry(3, sleepDurationProvider: attempt => TimeSpan.FromSeconds(2 * attempt));
135+
.WaitAndRetry(3, sleepDurationProvider: attempt => TimeSpan.FromSeconds(2 * attempt));
136136
}
137137
}

NGitLab/Impl/Json/Serializer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ internal static class Serializer
88
{
99
private static readonly JsonSerializerOptions _options = new()
1010
{
11-
IncludeFields = true,
1211
Converters =
1312
{
1413
new BooleanConverter(),

NGitLab/Models/AccessControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Text.Json.Serialization;
1+
using System.Text.Json.Serialization;
22

33
namespace NGitLab.Models;
44

0 commit comments

Comments
 (0)