File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
RubberduckTests/Inspections Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,52 @@ public void ImplicitlyTypedConst_DoesNotReturnResult()
53
53
Assert . AreEqual ( expected , actual ) ;
54
54
}
55
55
56
+ [ Test ]
57
+ [ Category ( "Inspections" ) ]
58
+ [ TestCase ( "!" ) ]
59
+ [ TestCase ( "@" ) ]
60
+ [ TestCase ( "#" ) ]
61
+ [ TestCase ( "$" ) ]
62
+ [ TestCase ( "%" ) ]
63
+ [ TestCase ( "^" ) ]
64
+ [ TestCase ( "&" ) ]
65
+ public void ImplicitlyTypedConst_HasTypeHint_DoesNotReturnResult ( string typeHint )
66
+ {
67
+ string inputCode =
68
+ $@ "Public Sub Foo()
69
+ Const bar{ typeHint } = 0
70
+ End Sub" ;
71
+
72
+ const int expected = 0 ;
73
+
74
+ var results = InspectionResultsForModules ( ( "FooClass" , inputCode , ComponentType . ClassModule ) ) ;
75
+ var actual = results . Count ( ) ;
76
+ Assert . AreEqual ( expected , actual ) ;
77
+ }
78
+
79
+ [ Test ]
80
+ [ Category ( "Inspections" ) ]
81
+ [ TestCase ( "!" ) ]
82
+ [ TestCase ( "@" ) ]
83
+ [ TestCase ( "#" ) ]
84
+ //[TestCase("$")] Errors out
85
+ [ TestCase ( "%" ) ]
86
+ [ TestCase ( "^" ) ]
87
+ [ TestCase ( "&" ) ]
88
+ public void ImplicitlyTypedConst_AssignedValueHasTypeHint_ReturnsResult ( string typeHint )
89
+ {
90
+ string inputCode =
91
+ $@ "Public Sub Foo()
92
+ Const bar = 0{ typeHint }
93
+ End Sub" ;
94
+
95
+ const int expected = 1 ;
96
+
97
+ var results = InspectionResultsForModules ( ( "FooClass" , inputCode , ComponentType . ClassModule ) ) ;
98
+ var actual = results . Count ( ) ;
99
+ Assert . AreEqual ( expected , actual ) ;
100
+ }
101
+
56
102
[ Test ]
57
103
[ Category ( "Inspections" ) ]
58
104
public void ImplicitlyTypedConst_Ignored_DoesNotReturnResult ( )
You can’t perform that action at this time.
0 commit comments