Skip to content

Commit 6d8e44e

Browse files
committed
Fix Resharper warnings from upcoming new version
1 parent c0eb108 commit 6d8e44e

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

Diff for: src/JsonApiDotNetCore.SourceGenerators/SourceCodeWriter.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private void WriteNullableEnable()
9898

9999
private void WriteNamespaceImports(INamedTypeSymbol loggerFactoryInterface, INamedTypeSymbol resourceType, string? controllerNamespace)
100100
{
101-
_sourceBuilder.AppendLine($@"using {loggerFactoryInterface.ContainingNamespace};");
101+
_sourceBuilder.AppendLine($"using {loggerFactoryInterface.ContainingNamespace};");
102102

103103
_sourceBuilder.AppendLine("using JsonApiDotNetCore.Configuration;");
104104
_sourceBuilder.AppendLine("using JsonApiDotNetCore.Controllers;");
@@ -123,7 +123,7 @@ private void WriteOpenClassDeclaration(string controllerName, JsonApiEndpointsCo
123123
string baseClassName = GetControllerBaseClassName(endpointsToGenerate);
124124

125125
WriteIndent();
126-
_sourceBuilder.AppendLine($@"public sealed partial class {controllerName} : {baseClassName}<{resourceType.Name}, {idType}>");
126+
_sourceBuilder.AppendLine($"public sealed partial class {controllerName} : {baseClassName}<{resourceType.Name}, {idType}>");
127127

128128
WriteOpenCurly();
129129
}

Diff for: test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/MusicTrack.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations;
99
[Resource(ControllerNamespace = "JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations")]
1010
public sealed class MusicTrack : Identifiable<Guid>
1111
{
12-
[RegularExpression(@"(?im)^[{(]?[0-9A-F]{8}[-]?(?:[0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$")]
12+
[RegularExpression("(?im)^[{(]?[0-9A-F]{8}[-]?(?:[0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$")]
1313
public override Guid Id { get; set; }
1414

1515
[Attr]

Diff for: test/JsonApiDotNetCoreTests/IntegrationTests/NonJsonApiControllers/NonJsonApiControllerTests.cs

+10-12
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,13 @@ public async Task Get_skips_middleware_and_formatters()
4141
public async Task Post_skips_middleware_and_formatters()
4242
{
4343
// Arrange
44-
using var request = new HttpRequestMessage(HttpMethod.Post, "/NonJsonApi")
44+
using var request = new HttpRequestMessage(HttpMethod.Post, "/NonJsonApi");
45+
46+
request.Content = new StringContent("Jack")
4547
{
46-
Content = new StringContent("Jack")
48+
Headers =
4749
{
48-
Headers =
49-
{
50-
ContentType = new MediaTypeHeaderValue("text/plain")
51-
}
50+
ContentType = new MediaTypeHeaderValue("text/plain")
5251
}
5352
};
5453

@@ -90,14 +89,13 @@ public async Task Post_skips_error_handler()
9089
public async Task Put_skips_middleware_and_formatters()
9190
{
9291
// Arrange
93-
using var request = new HttpRequestMessage(HttpMethod.Put, "/NonJsonApi")
92+
using var request = new HttpRequestMessage(HttpMethod.Put, "/NonJsonApi");
93+
94+
request.Content = new StringContent("\"Jane\"")
9495
{
95-
Content = new StringContent("\"Jane\"")
96+
Headers =
9697
{
97-
Headers =
98-
{
99-
ContentType = new MediaTypeHeaderValue("application/json")
100-
}
98+
ContentType = new MediaTypeHeaderValue("application/json")
10199
}
102100
};
103101

Diff for: test/SourceGeneratorTests/ControllerGenerationTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ public sealed class Item : Identifiable<string?>
538538
GeneratorDriverRunResult runResult = driver.GetRunResult();
539539
runResult.Should().NotHaveDiagnostics();
540540

541-
runResult.Should().HaveProducedSourceCodeContaining(@"#nullable enable");
541+
runResult.Should().HaveProducedSourceCodeContaining("#nullable enable");
542542
}
543543

544544
[Fact]

0 commit comments

Comments
 (0)