Skip to content

Commit e47e69d

Browse files
committed
Remove string interpolation in source under test
1 parent d0f04e0 commit e47e69d

11 files changed

+100
-98
lines changed

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitBodyParam_ComplexReturn_Snapshot.generated.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ namespace Microsoft.AspNetCore.Http.Generated
8484

8585
private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
8686
{
87-
[(@"TestMapActions.cs", 16)] = (
87+
[(@"TestMapActions.cs", 18)] = (
8888
(methodInfo, options) =>
8989
{
9090
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
91-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 16));
91+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
9292
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
9393
},
9494
(del, options, inferredMetadataResult) =>
@@ -151,11 +151,11 @@ namespace Microsoft.AspNetCore.Http.Generated
151151
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
152152
return new RequestDelegateResult(targetDelegate, metadata);
153153
}),
154-
[(@"TestMapActions.cs", 18)] = (
154+
[(@"TestMapActions.cs", 20)] = (
155155
(methodInfo, options) =>
156156
{
157157
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
158-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
158+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 20));
159159
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
160160
},
161161
(del, options, inferredMetadataResult) =>

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitServiceParam_SimpleReturn_Snapshot.generated.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ namespace Microsoft.AspNetCore.Http.Generated
114114

115115
private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
116116
{
117-
[(@"TestMapActions.cs", 16)] = (
117+
[(@"TestMapActions.cs", 18)] = (
118118
(methodInfo, options) =>
119119
{
120120
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
121-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 16));
121+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
122122
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
123123
},
124124
(del, options, inferredMetadataResult) =>
@@ -173,11 +173,11 @@ namespace Microsoft.AspNetCore.Http.Generated
173173
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
174174
return new RequestDelegateResult(targetDelegate, metadata);
175175
}),
176-
[(@"TestMapActions.cs", 17)] = (
176+
[(@"TestMapActions.cs", 19)] = (
177177
(methodInfo, options) =>
178178
{
179179
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
180-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 17));
180+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 19));
181181
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
182182
},
183183
(del, options, inferredMetadataResult) =>
@@ -232,11 +232,11 @@ namespace Microsoft.AspNetCore.Http.Generated
232232
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
233233
return new RequestDelegateResult(targetDelegate, metadata);
234234
}),
235-
[(@"TestMapActions.cs", 18)] = (
235+
[(@"TestMapActions.cs", 20)] = (
236236
(methodInfo, options) =>
237237
{
238238
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
239-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
239+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 20));
240240
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
241241
},
242242
(del, options, inferredMetadataResult) =>

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitSource_SimpleReturn_Snapshot.generated.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ namespace Microsoft.AspNetCore.Http.Generated
8484

8585
private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
8686
{
87-
[(@"TestMapActions.cs", 16)] = (
87+
[(@"TestMapActions.cs", 18)] = (
8888
(methodInfo, options) =>
8989
{
9090
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
91-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 16));
91+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
9292
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
9393
},
9494
(del, options, inferredMetadataResult) =>
@@ -153,11 +153,11 @@ namespace Microsoft.AspNetCore.Http.Generated
153153
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
154154
return new RequestDelegateResult(targetDelegate, metadata);
155155
}),
156-
[(@"TestMapActions.cs", 17)] = (
156+
[(@"TestMapActions.cs", 19)] = (
157157
(methodInfo, options) =>
158158
{
159159
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
160-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 17));
160+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 19));
161161
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
162162
},
163163
(del, options, inferredMetadataResult) =>
@@ -222,11 +222,11 @@ namespace Microsoft.AspNetCore.Http.Generated
222222
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
223223
return new RequestDelegateResult(targetDelegate, metadata);
224224
}),
225-
[(@"TestMapActions.cs", 18)] = (
225+
[(@"TestMapActions.cs", 20)] = (
226226
(methodInfo, options) =>
227227
{
228228
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
229-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
229+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 20));
230230
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
231231
},
232232
(del, options, inferredMetadataResult) =>
@@ -299,11 +299,11 @@ namespace Microsoft.AspNetCore.Http.Generated
299299
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
300300
return new RequestDelegateResult(targetDelegate, metadata);
301301
}),
302-
[(@"TestMapActions.cs", 19)] = (
302+
[(@"TestMapActions.cs", 21)] = (
303303
(methodInfo, options) =>
304304
{
305305
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
306-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 19));
306+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 21));
307307
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
308308
},
309309
(del, options, inferredMetadataResult) =>
@@ -368,11 +368,11 @@ namespace Microsoft.AspNetCore.Http.Generated
368368
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
369369
return new RequestDelegateResult(targetDelegate, metadata);
370370
}),
371-
[(@"TestMapActions.cs", 20)] = (
371+
[(@"TestMapActions.cs", 22)] = (
372372
(methodInfo, options) =>
373373
{
374374
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
375-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 20));
375+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 22));
376376
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
377377
},
378378
(del, options, inferredMetadataResult) =>

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_MultipleSpecialTypeParam_StringReturn.generated.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ namespace Microsoft.AspNetCore.Http.Generated
8484

8585
private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
8686
{
87-
[(@"TestMapActions.cs", 16)] = (
87+
[(@"TestMapActions.cs", 18)] = (
8888
(methodInfo, options) =>
8989
{
9090
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
91-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 16));
91+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
9292
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
9393
},
9494
(del, options, inferredMetadataResult) =>

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_MultipleStringParam_StringReturn.generated.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ namespace Microsoft.AspNetCore.Http.Generated
8484

8585
private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
8686
{
87-
[(@"TestMapActions.cs", 16)] = (
87+
[(@"TestMapActions.cs", 18)] = (
8888
(methodInfo, options) =>
8989
{
9090
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
91-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 16));
91+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
9292
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
9393
},
9494
(del, options, inferredMetadataResult) =>

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_NoParam_StringReturn_WithFilter.generated.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ namespace Microsoft.AspNetCore.Http.Generated
8484

8585
private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
8686
{
87-
[(@"TestMapActions.cs", 16)] = (
87+
[(@"TestMapActions.cs", 18)] = (
8888
(methodInfo, options) =>
8989
{
9090
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
91-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 16));
91+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
9292
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
9393
},
9494
(del, options, inferredMetadataResult) =>

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_SingleNullableStringParam_WithEmptyQueryStringValueProvided_StringReturn.generated.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ namespace Microsoft.AspNetCore.Http.Generated
8484

8585
private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
8686
{
87-
[(@"TestMapActions.cs", 16)] = (
87+
[(@"TestMapActions.cs", 18)] = (
8888
(methodInfo, options) =>
8989
{
9090
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
91-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 16));
91+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
9292
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
9393
},
9494
(del, options, inferredMetadataResult) =>

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/Multiple_MapAction_NoParam_StringReturn.generated.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ namespace Microsoft.AspNetCore.Http.Generated
114114

115115
private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
116116
{
117-
[(@"TestMapActions.cs", 16)] = (
117+
[(@"TestMapActions.cs", 18)] = (
118118
(methodInfo, options) =>
119119
{
120120
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
121-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 16));
121+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
122122
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
123123
},
124124
(del, options, inferredMetadataResult) =>
@@ -169,11 +169,11 @@ namespace Microsoft.AspNetCore.Http.Generated
169169
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
170170
return new RequestDelegateResult(targetDelegate, metadata);
171171
}),
172-
[(@"TestMapActions.cs", 17)] = (
172+
[(@"TestMapActions.cs", 19)] = (
173173
(methodInfo, options) =>
174174
{
175175
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
176-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 17));
176+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 19));
177177
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
178178
},
179179
(del, options, inferredMetadataResult) =>
@@ -224,11 +224,11 @@ namespace Microsoft.AspNetCore.Http.Generated
224224
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
225225
return new RequestDelegateResult(targetDelegate, metadata);
226226
}),
227-
[(@"TestMapActions.cs", 18)] = (
227+
[(@"TestMapActions.cs", 20)] = (
228228
(methodInfo, options) =>
229229
{
230230
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
231-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
231+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 20));
232232
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
233233
},
234234
(del, options, inferredMetadataResult) =>
@@ -279,11 +279,11 @@ namespace Microsoft.AspNetCore.Http.Generated
279279
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
280280
return new RequestDelegateResult(targetDelegate, metadata);
281281
}),
282-
[(@"TestMapActions.cs", 19)] = (
282+
[(@"TestMapActions.cs", 21)] = (
283283
(methodInfo, options) =>
284284
{
285285
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
286-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 19));
286+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 21));
287287
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
288288
},
289289
(del, options, inferredMetadataResult) =>

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/Multiple_MapAction_WithParams_StringReturn.generated.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ namespace Microsoft.AspNetCore.Http.Generated
114114

115115
private static readonly Dictionary<(string, int), (MetadataPopulator, RequestDelegateFactoryFunc)> map = new()
116116
{
117-
[(@"TestMapActions.cs", 16)] = (
117+
[(@"TestMapActions.cs", 18)] = (
118118
(methodInfo, options) =>
119119
{
120120
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
121-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 16));
121+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
122122
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
123123
},
124124
(del, options, inferredMetadataResult) =>
@@ -169,11 +169,11 @@ namespace Microsoft.AspNetCore.Http.Generated
169169
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
170170
return new RequestDelegateResult(targetDelegate, metadata);
171171
}),
172-
[(@"TestMapActions.cs", 17)] = (
172+
[(@"TestMapActions.cs", 19)] = (
173173
(methodInfo, options) =>
174174
{
175175
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
176-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 17));
176+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 19));
177177
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
178178
},
179179
(del, options, inferredMetadataResult) =>
@@ -224,11 +224,11 @@ namespace Microsoft.AspNetCore.Http.Generated
224224
var metadata = inferredMetadataResult?.EndpointMetadata ?? ReadOnlyCollection<object>.Empty;
225225
return new RequestDelegateResult(targetDelegate, metadata);
226226
}),
227-
[(@"TestMapActions.cs", 18)] = (
227+
[(@"TestMapActions.cs", 20)] = (
228228
(methodInfo, options) =>
229229
{
230230
Debug.Assert(options?.EndpointBuilder != null, "EndpointBuilder not found.");
231-
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 18));
231+
options.EndpointBuilder.Metadata.Add(new SourceKey(@"TestMapActions.cs", 20));
232232
return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };
233233
},
234234
(del, options, inferredMetadataResult) =>

src/Http/Http.Extensions/test/RequestDelegateGenerator/RequestDelegateGeneratorTestBase.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ private static string GetMapActionString(string sources) => $$"""
195195
using Microsoft.AspNetCore.Http;
196196
using Microsoft.AspNetCore.Http.Metadata;
197197
using Microsoft.AspNetCore.Mvc;
198+
using Microsoft.AspNetCore.Mvc.ModelBinding;
198199
using Microsoft.AspNetCore.Routing;
200+
using Microsoft.AspNetCore.Http.Generators.Tests;
199201
200202
public static class TestMapActions
201203
{

0 commit comments

Comments
 (0)