Skip to content

Commit 749e588

Browse files
authored
Merge pull request #1694 from json-api-dotnet/merge-master-into-openapi
Merge master into openapi
2 parents fcd3aa1 + 61c6cd5 commit 749e588

File tree

218 files changed

+4752
-4741
lines changed

Some content is hidden

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

218 files changed

+4752
-4741
lines changed

.config/dotnet-tools.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2024.3.5",
6+
"version": "2024.3.6",
77
"commands": [
88
"jb"
99
],

.editorconfig

+8
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ csharp_style_expression_bodied_properties = true:silent
113113
# IDE0025: Use expression body for properties
114114
dotnet_diagnostic.IDE0025.severity = silent
115115

116+
# Member preferences (these analyzers are unreliable)
117+
# IDE0051: Remove unused private member
118+
dotnet_diagnostic.IDE0051.severity = silent
119+
# IDE0052: Remove unread private member
120+
dotnet_diagnostic.IDE0052.severity = silent
121+
116122
# Code-block preferences
117123
csharp_prefer_braces = true:silent
118124
# IDE0011: Add braces
@@ -142,11 +148,13 @@ dotnet_diagnostic.IDE0047.severity = silent
142148
# IDE0048: Add parentheses for clarity
143149
dotnet_diagnostic.IDE0048.severity = silent
144150

151+
# Switch preferences
145152
# IDE0010: Add missing cases to switch statement
146153
dotnet_diagnostic.IDE0010.severity = silent
147154
# IDE0072: Add missing cases to switch expression
148155
dotnet_diagnostic.IDE0072.severity = silent
149156

157+
# Null check preferences
150158
# IDE0029: Null check can be simplified
151159
dotnet_diagnostic.IDE0029.severity = silent
152160
# IDE0030: Null check can be simplified

.github/workflows/build.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ concurrency:
2121
cancel-in-progress: true
2222

2323
env:
24-
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
24+
DOTNET_NOLOGO: true
2525
DOTNET_CLI_TELEMETRY_OPTOUT: true
2626

2727
jobs:
@@ -47,8 +47,8 @@ jobs:
4747
with:
4848
# Block buggy release from February 11, 2025
4949
dotnet-version: |
50-
8.0.309
51-
9.0.103
50+
8.0.*
51+
9.0.*
5252
- name: Show installed versions
5353
shell: pwsh
5454
run: |
@@ -166,8 +166,8 @@ jobs:
166166
with:
167167
# Block buggy release from February 11, 2025
168168
dotnet-version: |
169-
8.0.309
170-
9.0.103
169+
8.0.*
170+
9.0.*
171171
- name: Git checkout
172172
uses: actions/checkout@v4
173173
- name: Restore tools
@@ -222,8 +222,8 @@ jobs:
222222
with:
223223
# Block buggy release from February 11, 2025
224224
dotnet-version: |
225-
8.0.309
226-
9.0.103
225+
8.0.*
226+
9.0.*
227227
- name: Git checkout
228228
uses: actions/checkout@v4
229229
with:

Directory.Build.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Taking the suggestion TODAY produces List<string>, but the spec doesn't require that, so the compiler may change it over time.
2323
As a result, callers that cast back to List<string> will face a breaking change.
2424
-->
25-
<UseCollectionExpressionRules>IDE0028;IDE0300;IDE0301;IDE0302;IDE0303;IDE0304;IDE0305</UseCollectionExpressionRules>
25+
<UseCollectionExpressionRules>IDE0028;IDE0300;IDE0301;IDE0302;IDE0303;IDE0304;IDE0305;IDE0306</UseCollectionExpressionRules>
2626
<NoWarn>$(NoWarn);$(UseCollectionExpressionRules)</NoWarn>
2727

2828
<!-- Suppress warning that targeting .NET Standard 1.0 is not recommended, because it requires a breaking change. -->

package-versions.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<CodeAnalysisVersion>4.12.*</CodeAnalysisVersion>
1515
<CoverletVersion>6.0.*</CoverletVersion>
1616
<DapperVersion>2.1.*</DapperVersion>
17-
<FluentAssertionsVersion>7.0.*</FluentAssertionsVersion>
17+
<FluentAssertionsVersion>7.2.*</FluentAssertionsVersion>
1818
<GitHubActionsTestLoggerVersion>2.4.*</GitHubActionsTestLoggerVersion>
1919
<InheritDocVersion>2.0.*</InheritDocVersion>
2020
<KiotaVersion>1.*</KiotaVersion>

test/DapperTests/IntegrationTests/AtomicOperations/AtomicOperationsTests.cs

+39-39
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,20 @@ public async Task Can_use_multiple_operations()
168168
// Assert
169169
httpResponse.ShouldHaveStatusCode(HttpStatusCode.OK);
170170

171-
responseDocument.Results.ShouldHaveCount(7);
171+
responseDocument.Results.Should().HaveCount(7);
172172

173-
responseDocument.Results[0].Data.SingleValue.ShouldNotBeNull().With(resource => resource.Type.Should().Be("people"));
174-
responseDocument.Results[1].Data.SingleValue.ShouldNotBeNull().With(resource => resource.Type.Should().Be("people"));
175-
responseDocument.Results[2].Data.SingleValue.ShouldNotBeNull().With(resource => resource.Type.Should().Be("tags"));
176-
responseDocument.Results[3].Data.SingleValue.ShouldNotBeNull().With(resource => resource.Type.Should().Be("todoItems"));
173+
responseDocument.Results[0].Data.SingleValue.RefShould().NotBeNull().And.Subject.Type.Should().Be("people");
174+
responseDocument.Results[1].Data.SingleValue.RefShould().NotBeNull().And.Subject.Type.Should().Be("people");
175+
responseDocument.Results[2].Data.SingleValue.RefShould().NotBeNull().And.Subject.Type.Should().Be("tags");
176+
responseDocument.Results[3].Data.SingleValue.RefShould().NotBeNull().And.Subject.Type.Should().Be("todoItems");
177177
responseDocument.Results[4].Data.Value.Should().BeNull();
178-
responseDocument.Results[5].Data.SingleValue.ShouldNotBeNull().With(resource => resource.Type.Should().Be("todoItems"));
178+
responseDocument.Results[5].Data.SingleValue.RefShould().NotBeNull().And.Subject.Type.Should().Be("todoItems");
179179
responseDocument.Results[6].Data.Value.Should().BeNull();
180180

181-
long newOwnerId = long.Parse(responseDocument.Results[0].Data.SingleValue!.Id.ShouldNotBeNull());
182-
long newAssigneeId = long.Parse(responseDocument.Results[1].Data.SingleValue!.Id.ShouldNotBeNull());
183-
long newTagId = long.Parse(responseDocument.Results[2].Data.SingleValue!.Id.ShouldNotBeNull());
184-
long newTodoItemId = long.Parse(responseDocument.Results[3].Data.SingleValue!.Id.ShouldNotBeNull());
181+
long newOwnerId = long.Parse(responseDocument.Results[0].Data.SingleValue!.Id.Should().NotBeNull().And.Subject);
182+
long newAssigneeId = long.Parse(responseDocument.Results[1].Data.SingleValue!.Id.Should().NotBeNull().And.Subject);
183+
long newTagId = long.Parse(responseDocument.Results[2].Data.SingleValue!.Id.Should().NotBeNull().And.Subject);
184+
long newTodoItemId = long.Parse(responseDocument.Results[3].Data.SingleValue!.Id.Should().NotBeNull().And.Subject);
185185

186186
await _testContext.RunOnDatabaseAsync(async dbContext =>
187187
{
@@ -203,14 +203,14 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
203203
todoItemInDatabase.CreatedAt.Should().Be(DapperTestContext.FrozenTime);
204204
todoItemInDatabase.LastModifiedAt.Should().Be(DapperTestContext.FrozenTime);
205205

206-
todoItemInDatabase.Owner.ShouldNotBeNull();
206+
todoItemInDatabase.Owner.Should().NotBeNull();
207207
todoItemInDatabase.Owner.Id.Should().Be(newOwnerId);
208208
todoItemInDatabase.Assignee.Should().BeNull();
209-
todoItemInDatabase.Tags.ShouldHaveCount(1);
209+
todoItemInDatabase.Tags.Should().HaveCount(1);
210210
todoItemInDatabase.Tags.ElementAt(0).Id.Should().Be(newTagId);
211211
});
212212

213-
store.SqlCommands.ShouldHaveCount(15);
213+
store.SqlCommands.Should().HaveCount(15);
214214

215215
store.SqlCommands[0].With(command =>
216216
{
@@ -220,7 +220,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
220220
RETURNING "Id"
221221
"""));
222222

223-
command.Parameters.ShouldHaveCount(3);
223+
command.Parameters.Should().HaveCount(3);
224224
command.Parameters.Should().Contain("@p1", newOwner.FirstName);
225225
command.Parameters.Should().Contain("@p2", newOwner.LastName);
226226
command.Parameters.Should().Contain("@p3", null);
@@ -234,7 +234,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
234234
WHERE t1."Id" = @p1
235235
"""));
236236

237-
command.Parameters.ShouldHaveCount(1);
237+
command.Parameters.Should().HaveCount(1);
238238
command.Parameters.Should().Contain("@p1", newOwnerId);
239239
});
240240

@@ -246,7 +246,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
246246
RETURNING "Id"
247247
"""));
248248

249-
command.Parameters.ShouldHaveCount(3);
249+
command.Parameters.Should().HaveCount(3);
250250
command.Parameters.Should().Contain("@p1", newAssignee.FirstName);
251251
command.Parameters.Should().Contain("@p2", newAssignee.LastName);
252252
command.Parameters.Should().Contain("@p3", null);
@@ -260,7 +260,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
260260
WHERE t1."Id" = @p1
261261
"""));
262262

263-
command.Parameters.ShouldHaveCount(1);
263+
command.Parameters.Should().HaveCount(1);
264264
command.Parameters.Should().Contain("@p1", newAssigneeId);
265265
});
266266

@@ -272,7 +272,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
272272
RETURNING "Id"
273273
"""));
274274

275-
command.Parameters.ShouldHaveCount(2);
275+
command.Parameters.Should().HaveCount(2);
276276
command.Parameters.Should().Contain("@p1", newTag.Name);
277277
command.Parameters.Should().Contain("@p2", null);
278278
});
@@ -285,7 +285,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
285285
WHERE t1."Id" = @p1
286286
"""));
287287

288-
command.Parameters.ShouldHaveCount(1);
288+
command.Parameters.Should().HaveCount(1);
289289
command.Parameters.Should().Contain("@p1", newTagId);
290290
});
291291

@@ -297,7 +297,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
297297
RETURNING "Id"
298298
"""));
299299

300-
command.Parameters.ShouldHaveCount(7);
300+
command.Parameters.Should().HaveCount(7);
301301
command.Parameters.Should().Contain("@p1", newTodoItem.Description);
302302
command.Parameters.Should().Contain("@p2", newTodoItem.Priority);
303303
command.Parameters.Should().Contain("@p3", newTodoItem.DurationInHours);
@@ -315,7 +315,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
315315
WHERE t1."Id" = @p1
316316
"""));
317317

318-
command.Parameters.ShouldHaveCount(1);
318+
command.Parameters.Should().HaveCount(1);
319319
command.Parameters.Should().Contain("@p1", newTodoItemId);
320320
});
321321

@@ -328,7 +328,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
328328
WHERE t1."Id" = @p1
329329
"""));
330330

331-
command.Parameters.ShouldHaveCount(1);
331+
command.Parameters.Should().HaveCount(1);
332332
command.Parameters.Should().Contain("@p1", newTodoItemId);
333333
});
334334

@@ -340,7 +340,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
340340
WHERE "Id" = @p2
341341
"""));
342342

343-
command.Parameters.ShouldHaveCount(2);
343+
command.Parameters.Should().HaveCount(2);
344344
command.Parameters.Should().Contain("@p1", newAssigneeId);
345345
command.Parameters.Should().Contain("@p2", newTodoItemId);
346346
});
@@ -354,7 +354,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
354354
WHERE t1."Id" = @p1
355355
"""));
356356

357-
command.Parameters.ShouldHaveCount(1);
357+
command.Parameters.Should().HaveCount(1);
358358
command.Parameters.Should().Contain("@p1", newTodoItemId);
359359
});
360360

@@ -366,7 +366,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
366366
WHERE "Id" = @p2
367367
"""));
368368

369-
command.Parameters.ShouldHaveCount(2);
369+
command.Parameters.Should().HaveCount(2);
370370
command.Parameters.Should().Contain("@p1", DapperTestContext.FrozenTime);
371371
command.Parameters.Should().Contain("@p2", newTodoItemId);
372372
});
@@ -379,7 +379,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
379379
WHERE "Id" = @p2
380380
"""));
381381

382-
command.Parameters.ShouldHaveCount(2);
382+
command.Parameters.Should().HaveCount(2);
383383
command.Parameters.Should().Contain("@p1", newTodoItemId);
384384
command.Parameters.Should().Contain("@p2", newTagId);
385385
});
@@ -392,7 +392,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
392392
WHERE t1."Id" = @p1
393393
"""));
394394

395-
command.Parameters.ShouldHaveCount(1);
395+
command.Parameters.Should().HaveCount(1);
396396
command.Parameters.Should().Contain("@p1", newTodoItemId);
397397
});
398398

@@ -403,7 +403,7 @@ DELETE FROM "People"
403403
WHERE "Id" = @p1
404404
"""));
405405

406-
command.Parameters.ShouldHaveCount(1);
406+
command.Parameters.Should().HaveCount(1);
407407
command.Parameters.Should().Contain("@p1", newAssigneeId);
408408
});
409409
}
@@ -469,13 +469,13 @@ public async Task Can_rollback_on_error()
469469
// Assert
470470
httpResponse.ShouldHaveStatusCode(HttpStatusCode.NotFound);
471471

472-
responseDocument.Errors.ShouldHaveCount(1);
472+
responseDocument.Errors.Should().HaveCount(1);
473473

474474
ErrorObject error = responseDocument.Errors[0];
475475
error.StatusCode.Should().Be(HttpStatusCode.NotFound);
476476
error.Title.Should().Be("A related resource does not exist.");
477477
error.Detail.Should().Be($"Related resource of type 'todoItems' with ID '{unknownTodoItemId}' in relationship 'assignedTodoItems' does not exist.");
478-
error.Source.ShouldNotBeNull();
478+
error.Source.Should().NotBeNull();
479479
error.Source.Pointer.Should().Be("/atomic:operations[1]");
480480

481481
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -484,7 +484,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
484484
peopleInDatabase.Should().BeEmpty();
485485
});
486486

487-
store.SqlCommands.ShouldHaveCount(5);
487+
store.SqlCommands.Should().HaveCount(5);
488488

489489
store.SqlCommands[0].With(command =>
490490
{
@@ -494,7 +494,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
494494
RETURNING "Id"
495495
"""));
496496

497-
command.Parameters.ShouldHaveCount(3);
497+
command.Parameters.Should().HaveCount(3);
498498
command.Parameters.Should().Contain("@p1", null);
499499
command.Parameters.Should().Contain("@p2", newPerson.LastName);
500500
command.Parameters.Should().Contain("@p3", null);
@@ -508,8 +508,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
508508
WHERE t1."Id" = @p1
509509
"""));
510510

511-
command.Parameters.ShouldHaveCount(1);
512-
command.Parameters.ShouldContainKey("@p1").With(value => value.ShouldNotBeNull());
511+
command.Parameters.Should().HaveCount(1);
512+
command.Parameters.Should().ContainKey("@p1").WhoseValue.Should().NotBeNull();
513513
});
514514

515515
store.SqlCommands[2].With(command =>
@@ -521,8 +521,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
521521
WHERE t1."Id" = @p1
522522
"""));
523523

524-
command.Parameters.ShouldHaveCount(1);
525-
command.Parameters.ShouldContainKey("@p1").With(value => value.ShouldNotBeNull());
524+
command.Parameters.Should().HaveCount(1);
525+
command.Parameters.Should().ContainKey("@p1").WhoseValue.Should().NotBeNull();
526526
});
527527

528528
store.SqlCommands[3].With(command =>
@@ -533,8 +533,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
533533
WHERE "Id" = @p2
534534
"""));
535535

536-
command.Parameters.ShouldHaveCount(2);
537-
command.Parameters.ShouldContainKey("@p1").With(value => value.ShouldNotBeNull());
536+
command.Parameters.Should().HaveCount(2);
537+
command.Parameters.Should().ContainKey("@p1").WhoseValue.Should().NotBeNull();
538538
command.Parameters.Should().Contain("@p2", unknownTodoItemId);
539539
});
540540

@@ -546,7 +546,7 @@ SELECT t1."Id"
546546
WHERE t1."Id" = @p1
547547
"""));
548548

549-
command.Parameters.ShouldHaveCount(1);
549+
command.Parameters.Should().HaveCount(1);
550550
command.Parameters.Should().Contain("@p1", unknownTodoItemId);
551551
});
552552
}

0 commit comments

Comments
 (0)