Skip to content

Commit c66fd05

Browse files
committed
chore: 调整测试细节,以期能够在CI中通过测试
1 parent 62885a2 commit c66fd05

24 files changed

+49
-47
lines changed

Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,8 @@
77

88
<LangVersion>latest</LangVersion>
99
</PropertyGroup>
10+
11+
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
12+
<PackageReference Include="Cuture.CodeAnalysis.LoggingCodeFixes" Version="1.0.1" PrivateAssets="all" />
13+
</ItemGroup>
1014
</Project>

test/ResponseCaching.Test.WebHost/Controllers/CacheByAllMixedController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public CacheByAllMixedController(ILogger<CacheByAllMixedController> logger)
3838
[ExecutingLock(ExecutingLockMode.CacheKeySingle)]
3939
public IEnumerable<WeatherForecast> Post([Required][FromQuery] int page, [Required][FromQuery] int pageSize, [FromBody] PageResultRequestDto input)
4040
{
41-
_logger.LogInformation("{0} - {1}", page, pageSize);
41+
_logger.LogInformation("{Page} - {PageSize}", page, pageSize);
4242
return TestDataGenerator.GetData((page - 1) * pageSize, pageSize);
4343
}
4444

@@ -54,7 +54,7 @@ public IEnumerable<WeatherForecast> Post([Required][FromQuery] int page, [Requir
5454
[Route("{Value1}/{Value2}")]
5555
public IEnumerable<WeatherForecast> PostWithPath([Required][FromQuery] int page, [Required][FromQuery] int pageSize, [FromBody] PageResultRequestDto input)
5656
{
57-
_logger.LogInformation("{0} - {1}", page, pageSize);
57+
_logger.LogInformation("{Page} - {PageSize}", page, pageSize);
5858
return TestDataGenerator.GetData((page - 1) * pageSize, pageSize);
5959
}
6060

test/ResponseCaching.Test.WebHost/Controllers/CacheByCustomModelKeyParserController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public IEnumerable<WeatherForecast> Post(PageResultRequestDto input)
3333
{
3434
int page = input.Page;
3535
int pageSize = input.PageSize;
36-
_logger.LogInformation("{0} - {1}", page, pageSize);
36+
_logger.LogInformation("{Page} - {PageSize}", page, pageSize);
3737
return TestDataGenerator.GetData(0, 5);
3838
}
3939

test/ResponseCaching.Test.WebHost/Controllers/CacheByFullQueryController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public CacheByFullQueryController(ILogger<CacheByFullQueryController> logger)
3131
[ExecutingLock(ExecutingLockMode.CacheKeySingle)]
3232
public IEnumerable<WeatherForecast> Get([Required] int page, [Required] int pageSize)
3333
{
34-
_logger.LogInformation("{0} - {1}", page, pageSize);
34+
_logger.LogInformation("{Page} - {PageSize}", page, pageSize);
3535
return TestDataGenerator.GetData((page - 1) * pageSize, pageSize);
3636
}
3737

test/ResponseCaching.Test.WebHost/Controllers/CacheByFullUrlController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public CacheByFullUrlController(ILogger<CacheByFullUrlController> logger)
3232
[ResponseDumpCapacity(128)]
3333
public IEnumerable<WeatherForecast> Get([Required] int page, [Required] int pageSize)
3434
{
35-
_logger.LogInformation("{0} - {1}", page, pageSize);
35+
_logger.LogInformation("{Page} - {PageSize}", page, pageSize);
3636
return TestDataGenerator.GetData((page - 1) * pageSize, pageSize);
3737
}
3838

test/ResponseCaching.Test.WebHost/Controllers/CacheByHeaderController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public IEnumerable<WeatherForecast> Get()
3232
{
3333
int page = int.Parse(Request.Headers["page"].ToString());
3434
int pageSize = int.Parse(Request.Headers["pageSize"].ToString());
35-
_logger.LogInformation("{0} - {1}", page, pageSize);
35+
_logger.LogInformation("{Page} - {PageSize}", page, pageSize);
3636
return TestDataGenerator.GetData((page - 1) * pageSize, pageSize);
3737
}
3838

test/ResponseCaching.Test.WebHost/Controllers/CacheByModelController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public IEnumerable<WeatherForecast> Post(PageResultRequestDto input)
3232
{
3333
int page = input.Page;
3434
int pageSize = input.PageSize;
35-
_logger.LogInformation("{0} - {1}", page, pageSize);
35+
_logger.LogInformation("{Page} - {PageSize}", page, pageSize);
3636
return TestDataGenerator.GetData((page - 1) * pageSize, pageSize);
3737
}
3838

test/ResponseCaching.Test.WebHost/Controllers/CacheByPathController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public CacheByPathController(ILogger<CacheByPathController> logger)
2929
[ExecutingLock(ExecutingLockMode.CacheKeySingle)]
3030
public IEnumerable<WeatherForecast> Get()
3131
{
32-
_logger.LogInformation("{0}", "path-cache Get");
32+
_logger.LogInformation("{String}", "path-cache Get");
3333
return TestDataGenerator.GetData(1, 5);
3434
}
3535

@@ -38,7 +38,7 @@ public IEnumerable<WeatherForecast> Get()
3838
[ExecutingLock(ExecutingLockMode.CacheKeySingle)]
3939
public IEnumerable<WeatherForecast> Post()
4040
{
41-
_logger.LogInformation("{0}", "path-cache Post");
41+
_logger.LogInformation("{String}", "path-cache Post");
4242
return TestDataGenerator.GetData(1, 5);
4343
}
4444

@@ -50,7 +50,7 @@ public IEnumerable<WeatherForecast> Post()
5050
[Route("/R1/{Value1}")]
5151
public IEnumerable<WeatherForecast> AbsoluteRoute1()
5252
{
53-
_logger.LogInformation("{0}", "path-cache AbsoluteRoute1");
53+
_logger.LogInformation("{String}", "path-cache AbsoluteRoute1");
5454
return TestDataGenerator.GetData(1, 5);
5555
}
5656

@@ -60,7 +60,7 @@ public IEnumerable<WeatherForecast> AbsoluteRoute1()
6060
[Route("R1/{Value1}")]
6161
public IEnumerable<WeatherForecast> RelativeRoute1()
6262
{
63-
_logger.LogInformation("{0}", "path-cache RelativeRoute1");
63+
_logger.LogInformation("{String}", "path-cache RelativeRoute1");
6464
return TestDataGenerator.GetData(1, 5);
6565
}
6666

test/ResponseCaching.Test.WebHost/Controllers/CacheByQueryController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public CacheByQueryController(ILogger<CacheByQueryController> logger)
3131
[ExecutingLock(ExecutingLockMode.CacheKeySingle)]
3232
public IEnumerable<WeatherForecast> Get([Required] int page, [Required] int pageSize)
3333
{
34-
_logger.LogInformation("{0} - {1}", page, pageSize);
34+
_logger.LogInformation("{Page} - {PageSize}", page, pageSize);
3535
return TestDataGenerator.GetData((page - 1) * pageSize, pageSize);
3636
}
3737

test/ResponseCaching.Test.WebHost/Controllers/CacheByQueryWithAuthorizeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public CacheByQueryWithAuthorizeController(ILogger<CacheByQueryWithAuthorizeCont
3333
[ExecutingLock(ExecutingLockMode.CacheKeySingle)]
3434
public IEnumerable<WeatherForecast> Get([Required] int page, [Required] int pageSize)
3535
{
36-
_logger.LogInformation("{0} - {1}", page, pageSize);
36+
_logger.LogInformation("{Page} - {PageSize}", page, pageSize);
3737
return TestDataGenerator.GetData((page - 1) * pageSize, pageSize);
3838
}
3939

0 commit comments

Comments
 (0)