@@ -8,32 +8,34 @@ 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:regex(a{{0,1}})}" , "string" ) ]
37+ [ TestCase ( "api/orders/{value:minlength(1):maxlength(2):required:alpha:regex(a{{0,1}})}" , "string" ) ]
38+ [ TestCase ( "api/orders/{value:required}" , "string" ) ]
3739 public void WithParameter ( string parameter , string type )
3840 {
3941 var code = @"
0 commit comments