Skip to content

Commit 8abd60d

Browse files
committed
Remove redundant TranslateAsync calls in tests
1 parent d180c5c commit 8abd60d

File tree

3 files changed

+23
-29
lines changed

3 files changed

+23
-29
lines changed

test/OpenApiNSwagEndToEndTests/ResourceInheritance/NoOperations/ResourceInheritanceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
933933
var apiClient = new NoOperationsInheritanceClient(httpClient);
934934

935935
// Act
936-
await ApiResponse.TranslateAsync(async () => await apiClient.DeleteBuildingAsync(existingMansion.StringId!));
936+
await apiClient.DeleteBuildingAsync(existingMansion.StringId!);
937937

938938
// Assert
939939
await _testContext.RunOnDatabaseAsync(async dbContext =>

test/OpenApiNSwagEndToEndTests/ResourceInheritance/OnlyRelationships/RelationshipInheritanceTests.cs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using FluentAssertions;
22
using JsonApiDotNetCore.AtomicOperations;
33
using JsonApiDotNetCore.Middleware;
4-
using JsonApiDotNetCore.OpenApi.Client.NSwag;
54
using Microsoft.EntityFrameworkCore;
65
using Microsoft.Extensions.DependencyInjection;
76
using OpenApiNSwagEndToEndTests.OnlyRelationshipsInheritance.GeneratedCode;
@@ -182,7 +181,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
182181
};
183182

184183
// Act
185-
await ApiResponse.TranslateAsync(async () => await apiClient.PatchRoomResidenceRelationshipAsync(existingBathroom.StringId!, requestBody));
184+
await apiClient.PatchRoomResidenceRelationshipAsync(existingBathroom.StringId!, requestBody);
186185

187186
// Assert
188187
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -225,7 +224,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
225224
};
226225

227226
// Act
228-
await ApiResponse.TranslateAsync(async () => await apiClient.PatchRoomResidenceRelationshipAsync(existingBathroom.StringId!, requestBody));
227+
await apiClient.PatchRoomResidenceRelationshipAsync(existingBathroom.StringId!, requestBody);
229228

230229
// Assert
231230
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -268,7 +267,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
268267
};
269268

270269
// Act
271-
await ApiResponse.TranslateAsync(async () => await apiClient.PatchBathroomResidenceRelationshipAsync(existingBathroom.StringId!, requestBody));
270+
await apiClient.PatchBathroomResidenceRelationshipAsync(existingBathroom.StringId!, requestBody);
272271

273272
// Assert
274273
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -311,7 +310,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
311310
};
312311

313312
// Act
314-
await ApiResponse.TranslateAsync(async () => await apiClient.PatchBathroomResidenceRelationshipAsync(existingBathroom.StringId!, requestBody));
313+
await apiClient.PatchBathroomResidenceRelationshipAsync(existingBathroom.StringId!, requestBody);
315314

316315
// Assert
317316
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -359,7 +358,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
359358
};
360359

361360
// Act
362-
await ApiResponse.TranslateAsync(async () => await apiClient.PatchResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
361+
await apiClient.PatchResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
363362

364363
// Assert
365364
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -407,7 +406,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
407406
};
408407

409408
// Act
410-
await ApiResponse.TranslateAsync(async () => await apiClient.PatchResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
409+
await apiClient.PatchResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
411410

412411
// Assert
413412
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -455,7 +454,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
455454
};
456455

457456
// Act
458-
await ApiResponse.TranslateAsync(async () => await apiClient.PatchMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
457+
await apiClient.PatchMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
459458

460459
// Assert
461460
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -503,7 +502,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
503502
};
504503

505504
// Act
506-
await ApiResponse.TranslateAsync(async () => await apiClient.PatchMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
505+
await apiClient.PatchMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
507506

508507
// Assert
509508
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -552,7 +551,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
552551
};
553552

554553
// Act
555-
await ApiResponse.TranslateAsync(async () => await apiClient.PostResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
554+
await apiClient.PostResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
556555

557556
// Assert
558557
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -602,7 +601,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
602601
};
603602

604603
// Act
605-
await ApiResponse.TranslateAsync(async () => await apiClient.PostResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
604+
await apiClient.PostResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
606605

607606
// Assert
608607
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -652,7 +651,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
652651
};
653652

654653
// Act
655-
await ApiResponse.TranslateAsync(async () => await apiClient.PostMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
654+
await apiClient.PostMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
656655

657656
// Assert
658657
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -702,7 +701,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
702701
};
703702

704703
// Act
705-
await ApiResponse.TranslateAsync(async () => await apiClient.PostMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
704+
await apiClient.PostMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
706705

707706
// Assert
708707
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -747,7 +746,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
747746
};
748747

749748
// Act
750-
await ApiResponse.TranslateAsync(async () => await apiClient.DeleteResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
749+
await apiClient.DeleteResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
751750

752751
// Assert
753752
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -790,7 +789,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
790789
};
791790

792791
// Act
793-
await ApiResponse.TranslateAsync(async () => await apiClient.DeleteResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
792+
await apiClient.DeleteResidenceRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
794793

795794
// Assert
796795
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -833,7 +832,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
833832
};
834833

835834
// Act
836-
await ApiResponse.TranslateAsync(async () => await apiClient.DeleteMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
835+
await apiClient.DeleteMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
837836

838837
// Assert
839838
await _testContext.RunOnDatabaseAsync(async dbContext =>
@@ -876,7 +875,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
876875
};
877876

878877
// Act
879-
await ApiResponse.TranslateAsync(async () => await apiClient.DeleteMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody));
878+
await apiClient.DeleteMansionRoomsRelationshipAsync(existingMansion.StringId!, requestBody);
880879

881880
// Assert
882881
await _testContext.RunOnDatabaseAsync(async dbContext =>

test/OpenApiNSwagEndToEndTests/RestrictedControllers/UpdateRelationshipTests.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
5555
};
5656

5757
// Act
58-
await ApiResponse.TranslateAsync(async () =>
59-
await apiClient.PatchWriteOnlyChannelUltraHighDefinitionVideoStreamRelationshipAsync(existingChannel.StringId!, requestBody));
58+
await apiClient.PatchWriteOnlyChannelUltraHighDefinitionVideoStreamRelationshipAsync(existingChannel.StringId!, requestBody);
6059

6160
await _testContext.RunOnDatabaseAsync(async dbContext =>
6261
{
@@ -98,8 +97,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
9897
};
9998

10099
// Act
101-
await ApiResponse.TranslateAsync(async () =>
102-
await apiClient.PatchWriteOnlyChannelUltraHighDefinitionVideoStreamRelationshipAsync(existingChannel.StringId!, requestBody));
100+
await apiClient.PatchWriteOnlyChannelUltraHighDefinitionVideoStreamRelationshipAsync(existingChannel.StringId!, requestBody);
103101

104102
await _testContext.RunOnDatabaseAsync(async dbContext =>
105103
{
@@ -149,8 +147,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
149147
};
150148

151149
// Act
152-
await ApiResponse.TranslateAsync(async () =>
153-
await apiClient.PatchWriteOnlyChannelAudioStreamsRelationshipAsync(existingChannel.StringId!, requestBody));
150+
await apiClient.PatchWriteOnlyChannelAudioStreamsRelationshipAsync(existingChannel.StringId!, requestBody);
154151

155152
await _testContext.RunOnDatabaseAsync(async dbContext =>
156153
{
@@ -192,8 +189,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
192189
};
193190

194191
// Act
195-
await ApiResponse.TranslateAsync(async () =>
196-
await apiClient.PatchWriteOnlyChannelAudioStreamsRelationshipAsync(existingChannel.StringId!, requestBody));
192+
await apiClient.PatchWriteOnlyChannelAudioStreamsRelationshipAsync(existingChannel.StringId!, requestBody);
197193

198194
await _testContext.RunOnDatabaseAsync(async dbContext =>
199195
{
@@ -243,7 +239,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
243239
};
244240

245241
// Act
246-
await ApiResponse.TranslateAsync(async () => await apiClient.PostWriteOnlyChannelAudioStreamsRelationshipAsync(existingChannel.StringId!, requestBody));
242+
await apiClient.PostWriteOnlyChannelAudioStreamsRelationshipAsync(existingChannel.StringId!, requestBody);
247243

248244
await _testContext.RunOnDatabaseAsync(async dbContext =>
249245
{
@@ -296,8 +292,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
296292
};
297293

298294
// Act
299-
await ApiResponse.TranslateAsync(async () =>
300-
await apiClient.DeleteWriteOnlyChannelAudioStreamsRelationshipAsync(existingChannel.StringId!, requestBody));
295+
await apiClient.DeleteWriteOnlyChannelAudioStreamsRelationshipAsync(existingChannel.StringId!, requestBody);
301296

302297
await _testContext.RunOnDatabaseAsync(async dbContext =>
303298
{

0 commit comments

Comments
 (0)