@@ -8,32 +8,32 @@ public class ValidCode
88 {
99 private static readonly DiagnosticAnalyzer Analyzer = new AttributeAnalyzer ( ) ;
1010
11- [ TestCase ( "{value}" , "string" ) ]
12- [ TestCase ( "{value?}" , "string" ) ]
13- [ TestCase ( "{value:bool}" , "bool" ) ]
14- [ TestCase ( "{value:datetime}" , "System.DateTime" ) ]
15- [ TestCase ( "{value:decimal}" , "decimal" ) ]
16- [ TestCase ( "{value:double}" , "double" ) ]
17- [ TestCase ( "{value:float}" , "float" ) ]
18- [ TestCase ( "{value:int}" , "int" ) ]
19- [ TestCase ( "api/orders/{value:int:min(1)}" , "int" ) ]
20- [ TestCase ( "api/orders/{value:int:max(1)}" , "int" ) ]
21- [ TestCase ( "api/orders/{value:int:range(1,10)}" , "int" ) ]
22- [ TestCase ( "api/orders/{value:int:required}" , "int" ) ]
23- [ TestCase ( "{value:long}" , "long" ) ]
24- [ TestCase ( "api/orders/{value:min(1)}" , "long" ) ]
25- [ TestCase ( "api/orders/{value:max(1)}" , "long" ) ]
26- [ TestCase ( "api/orders/{value:range(1,10)}" , "long" ) ]
27- [ TestCase ( "api/orders/{value:required}" , "long" ) ]
28- [ TestCase ( "{value:guid}" , "System.Guid" ) ]
29- [ TestCase ( "api/orders/{value:minlength(1)}" , "string" ) ]
30- [ TestCase ( "api/orders/{value:maxlength(1)}" , "string" ) ]
31- [ TestCase ( "api/orders/{value:length(1)}" , "string" ) ]
32- [ TestCase ( "api/orders/{value:length(1,3)}" , "string" ) ]
33- [ TestCase ( "api/orders/{value:alpha}" , "string" ) ]
34- [ TestCase ( "api/orders/{value:regex(a-(0|1))}" , "string" ) ]
35- [ TestCase ( "api/orders/{value:regex(^\\ \\ \\ \\ d{{3}}-\\ \\ \\ \\ d{{2}}-\\ \\ \\ \\ d{{4}}$)}" , "string" ) ]
36- [ TestCase ( "api/orders/{value:required}" , "string" ) ]
11+ [ TestCase ( "\" {value}\" " , "string" ) ]
12+ [ TestCase ( "\" {value?}\" " , "string" ) ]
13+ [ TestCase ( "\" {value:bool}\" " , "bool" ) ]
14+ [ TestCase ( "\" {value:datetime}\" " , "System.DateTime" ) ]
15+ [ TestCase ( "\" {value:decimal}\" " , "decimal" ) ]
16+ [ TestCase ( "\" {value:double}\" " , "double" ) ]
17+ [ TestCase ( "\" {value:float}\" " , "float" ) ]
18+ [ TestCase ( "\" {value:int}\" " , "int" ) ]
19+ [ TestCase ( "\" api/orders/{value:int:min(1)}\" " , "int" ) ]
20+ [ TestCase ( "\" api/orders/{value:int:max(1)}\" " , "int" ) ]
21+ [ TestCase ( "\" api/orders/{value:int:range(1,10)}\" " , "int" ) ]
22+ [ TestCase ( "\" api/orders/{value:int:required}\" " , "int" ) ]
23+ [ TestCase ( "\" {value:long}\" " , "long" ) ]
24+ [ TestCase ( "\" api/orders/{value:min(1)}\" " , "long" ) ]
25+ [ TestCase ( "\" api/orders/{value:max(1)}\" " , "long" ) ]
26+ [ TestCase ( "\" api/orders/{value:range(1,10)}\" " , "long" ) ]
27+ [ TestCase ( "\" api/orders/{value:required}\" " , "long" ) ]
28+ [ TestCase ( "\" {value:guid}\" " , "System.Guid" ) ]
29+ [ TestCase ( "\" api/orders/{value:minlength(1)}\" " , "string" ) ]
30+ [ TestCase ( "\" api/orders/{value:maxlength(1)}\" " , "string" ) ]
31+ [ TestCase ( "\" api/orders/{value:length(1)}\" " , "string" ) ]
32+ [ TestCase ( "\" api/orders/{value:length(1,3)}\" " , "string" ) ]
33+ [ TestCase ( "\" api/orders/{value:alpha}\" " , "string" ) ]
34+ [ TestCase ( "\" api/orders/{value:regex(a-(0|1))}\" " , "string" ) ]
35+ [ TestCase ( "\" api/orders/{value:regex(^\\ \\ \\ \\ d{{3}}-\\ \\ \\ \\ d{{2}}-\\ \\ \\ \\ d{{4}}$)}\" " , "string" ) ]
36+ [ TestCase ( "\" api/orders/{value:required}\" " , "string" ) ]
3737 public void WithParameter ( string parameter , string type )
3838 {
3939 var code = @"
@@ -52,7 +52,7 @@ public IActionResult GetValue(string value)
5252 return this.Ok(value);
5353 }
5454 }
55- }" . AssertReplace ( "{value}" , parameter )
55+ }" . AssertReplace ( "\" api/ {value}\" " , parameter )
5656 . AssertReplace ( "string" , type ) ;
5757 AnalyzerAssert . Valid ( Analyzer , code ) ;
5858 }
0 commit comments