55using  System . Linq ; 
66using  Rubberduck . Parsing ; 
77using  Rubberduck . Parsing . Symbols ; 
8+ using  Rubberduck . Parsing . VBA ; 
89using  Rubberduck . UI ; 
910using  Rubberduck . UI . Controls ; 
1011using  Rubberduck . VBEditor ; 
@@ -19,9 +20,11 @@ public class TestMethod : ViewModelBase, IEquatable<TestMethod>, INavigateSource
1920        private  readonly  ICollection < AssertCompletedEventArgs >  _assertResults  =  new  List < AssertCompletedEventArgs > ( ) ; 
2021        private  readonly  IVBE  _vbe ; 
2122        private  readonly  IVBETypeLibsAPI  _typeLibApi ; 
23+         private  readonly  RubberduckParserState  _state ; 
2224
23-         public  TestMethod ( Declaration  declaration ,  IVBE  vbe ,  IVBETypeLibsAPI  typeLibApi ) 
25+         public  TestMethod ( RubberduckParserState   state ,   Declaration  declaration ,  IVBE  vbe ,  IVBETypeLibsAPI  typeLibApi ) 
2426        { 
27+             _state  =  state ; 
2528            _declaration  =  declaration ; 
2629            _vbe  =  vbe ; 
2730            _typeLibApi  =  typeLibApi ; 
@@ -46,7 +49,8 @@ public void Run()
4649            try 
4750            { 
4851                AssertHandler . OnAssertCompleted  +=  HandleAssertCompleted ; 
49-                 _typeLibApi . ExecuteCode ( _vbe ,  Declaration . ProjectName ,  Declaration . QualifiedModuleName . ComponentName , 
52+                 var  project  =  _state . ProjectsProvider . Project ( Declaration . ProjectId ) ; 
53+                 _typeLibApi . ExecuteCode ( project ,  Declaration . QualifiedModuleName . ComponentName , 
5054                    Declaration . QualifiedName . MemberName ) ; 
5155                AssertHandler . OnAssertCompleted  -=  HandleAssertCompleted ; 
5256
0 commit comments