Skip to content

Commit cde7b63

Browse files
committed
Resharper: Use lambda expression
1 parent 3e1b27b commit cde7b63

34 files changed

+40
-160
lines changed

test/DapperTests/IntegrationTests/AtomicOperations/AtomicOperationsTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,7 @@ public async Task Can_rollback_on_error()
396396

397397
const string personLocalId = "new-person";
398398

399-
await _testContext.RunOnDatabaseAsync(dbContext =>
400-
{
401-
return _testContext.ClearAllTablesAsync(dbContext);
402-
});
399+
await _testContext.RunOnDatabaseAsync(dbContext => _testContext.ClearAllTablesAsync(dbContext));
403400

404401
var requestBody = new
405402
{

test/JsonApiDotNetCoreTests/IntegrationTests/Archiving/ArchiveTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ public ArchiveTests(IntegrationTestContext<TestableStartup<TelevisionDbContext>,
2121
testContext.UseController<TelevisionBroadcastsController>();
2222
testContext.UseController<BroadcastCommentsController>();
2323

24-
testContext.ConfigureServices(services =>
25-
{
26-
services.AddResourceDefinition<TelevisionBroadcastDefinition>();
27-
});
24+
testContext.ConfigureServices(services => services.AddResourceDefinition<TelevisionBroadcastDefinition>());
2825
}
2926

3027
[Fact]

test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Creating/AtomicCreateResourceTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ public AtomicCreateResourceTests(IntegrationTestContext<TestableStartup<Operatio
2626
testContext.UseController<MusicTracksController>();
2727
testContext.UseController<PlaylistsController>();
2828

29-
testContext.ConfigureServices(services =>
30-
{
31-
services.AddSingleton<ISystemClock, FrozenSystemClock>();
32-
});
29+
testContext.ConfigureServices(services => services.AddSingleton<ISystemClock, FrozenSystemClock>());
3330

3431
var options = (JsonApiOptions)testContext.Factory.Services.GetRequiredService<IJsonApiOptions>();
3532
options.AllowUnknownFieldsInRequestBody = false;

test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicAbsoluteLinksTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ public AtomicAbsoluteLinksTests(IntegrationTestContext<TestableStartup<Operation
2525
testContext.UseController<TextLanguagesController>();
2626
testContext.UseController<RecordCompaniesController>();
2727

28-
testContext.ConfigureServices(services =>
29-
{
30-
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
31-
});
28+
testContext.ConfigureServices(services => services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)));
3229
}
3330

3431
[Fact]

test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Links/AtomicRelativeLinksWithNamespaceTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ public AtomicRelativeLinksWithNamespaceTests(
2626
testContext.UseController<TextLanguagesController>();
2727
testContext.UseController<RecordCompaniesController>();
2828

29-
testContext.ConfigureServices(services =>
30-
{
31-
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
32-
});
29+
testContext.ConfigureServices(services => services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)));
3330
}
3431

3532
[Fact]

test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Mixed/AtomicTraceLoggingTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ public AtomicTraceLoggingTests(IntegrationTestContext<TestableStartup<Operations
2929
options.AddFilter((category, _) => category != null && category.StartsWith("JsonApiDotNetCore.", StringComparison.Ordinal));
3030
});
3131

32-
testContext.ConfigureServices(services =>
33-
{
34-
services.AddSingleton(loggerFactory);
35-
});
32+
testContext.ConfigureServices(services => services.AddSingleton(loggerFactory));
3633
}
3734

3835
[Fact]

test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ModelStateValidation/AtomicModelStateValidationTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ public AtomicModelStateValidationTests(IntegrationTestContext<TestableStartup<Op
1717
{
1818
_testContext = testContext;
1919

20-
_testContext.ConfigureServices(services =>
21-
{
22-
services.AddSingleton<ISystemClock, FrozenSystemClock>();
23-
});
20+
_testContext.ConfigureServices(services => services.AddSingleton<ISystemClock, FrozenSystemClock>());
2421

2522
testContext.UseController<OperationsController>();
2623
}

test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/ResourceDefinitions/Serialization/AtomicSerializationResourceDefinitionTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ public async Task Transforms_on_create_resource_with_side_effects()
4242

4343
List<RecordCompany> newCompanies = _fakers.RecordCompany.Generate(2);
4444

45-
await _testContext.RunOnDatabaseAsync(dbContext =>
46-
{
47-
return dbContext.ClearTableAsync<RecordCompany>();
48-
});
45+
await _testContext.RunOnDatabaseAsync(dbContext => dbContext.ClearTableAsync<RecordCompany>());
4946

5047
var requestBody = new
5148
{

test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/Transactions/AtomicRollbackTests.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ public async Task Can_rollback_on_error()
2727
DateTimeOffset newBornAt = _fakers.Performer.Generate().BornAt;
2828
string newTitle = _fakers.MusicTrack.Generate().Title;
2929

30-
await _testContext.RunOnDatabaseAsync(dbContext =>
31-
{
32-
return dbContext.ClearTablesAsync<Performer, MusicTrack>();
33-
});
30+
await _testContext.RunOnDatabaseAsync(dbContext => dbContext.ClearTablesAsync<Performer, MusicTrack>());
3431

3532
string unknownPerformerId = Unknown.StringId.For<Performer, int>();
3633

@@ -113,10 +110,7 @@ public async Task Can_restore_to_previous_savepoint_on_error()
113110
// Arrange
114111
string newTrackTitle = _fakers.MusicTrack.Generate().Title;
115112

116-
await _testContext.RunOnDatabaseAsync(dbContext =>
117-
{
118-
return dbContext.ClearTablesAsync<Performer, MusicTrack>();
119-
});
113+
await _testContext.RunOnDatabaseAsync(dbContext => dbContext.ClearTablesAsync<Performer, MusicTrack>());
120114

121115
const string trackLid = "track-1";
122116

test/JsonApiDotNetCoreTests/IntegrationTests/Blobs/BlobTests.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ public BlobTests(IntegrationTestContext<TestableStartup<BlobDbContext>, BlobDbCo
1919

2020
testContext.UseController<ImageContainersController>();
2121

22-
testContext.ConfigureServices(services =>
23-
{
24-
services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>));
25-
});
22+
testContext.ConfigureServices(services => services.AddScoped(typeof(IResourceChangeTracker<>), typeof(NeverSameResourceChangeTracker<>)));
2623
}
2724

2825
[Fact]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy