@@ -279,6 +279,38 @@ public void VariableTypeNotDeclared_QuickFixWorks_Parameter()
279
279
Assert . AreEqual ( expectedCode , actual ) ;
280
280
}
281
281
282
+ [ TestMethod ]
283
+ [ TestCategory ( "Inspections" ) ]
284
+ public void VariableTypeNotDeclared_QuickFixWorks_SubNameContainsParameterName ( )
285
+ {
286
+ const string inputCode =
287
+ @"Sub Foo(Foo)
288
+ End Sub" ;
289
+
290
+ const string expectedCode =
291
+ @"Sub Foo(Foo As Variant)
292
+ End Sub" ;
293
+
294
+ //Arrange
295
+ var builder = new MockVbeBuilder ( ) ;
296
+ VBComponent component ;
297
+ var vbe = builder . BuildFromSingleStandardModule ( inputCode , out component ) ;
298
+ var project = vbe . Object . VBProjects . Item ( 0 ) ;
299
+ var module = project . VBComponents . Item ( 0 ) . CodeModule ;
300
+ var mockHost = new Mock < IHostApplication > ( ) ;
301
+ mockHost . SetupAllProperties ( ) ;
302
+ var parser = MockParser . Create ( vbe . Object , new RubberduckParserState ( vbe . Object , new Mock < ISinks > ( ) . Object ) ) ;
303
+
304
+ parser . Parse ( new CancellationTokenSource ( ) ) ;
305
+ if ( parser . State . Status >= ParserState . Error ) { Assert . Inconclusive ( "Parser Error" ) ; }
306
+
307
+ var inspection = new VariableTypeNotDeclaredInspection ( parser . State ) ;
308
+ inspection . GetInspectionResults ( ) . First ( ) . QuickFixes . First ( ) . Fix ( ) ;
309
+
310
+ var actual = module . Lines ( ) ;
311
+ Assert . AreEqual ( expectedCode , actual ) ;
312
+ }
313
+
282
314
[ TestMethod ]
283
315
[ TestCategory ( "Inspections" ) ]
284
316
public void VariableTypeNotDeclared_QuickFixWorks_Variable ( )
0 commit comments