File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Linq ;
2
3
using System . Threading ;
3
4
using Microsoft . VisualStudio . TestTools . UnitTesting ;
4
5
using Moq ;
6
+ using Rubberduck . Parsing . Annotations ;
5
7
using Rubberduck . Parsing . VBA ;
6
8
using Rubberduck . Settings ;
7
9
using Rubberduck . UI . Command ;
@@ -297,15 +299,6 @@ Private Assert As Object
297
299
[ TestMethod ]
298
300
public void AddsTestModule ( )
299
301
{
300
- var expected = @"
301
- Option Explicit
302
- Option Private Module
303
-
304
- '@TestModule
305
- Private Assert As New Rubberduck.AssertClass
306
-
307
- " ;
308
-
309
302
var builder = new MockVbeBuilder ( ) ;
310
303
IVBComponent component ;
311
304
var vbe = builder . BuildFromSingleStandardModule ( "" , out component ) ;
@@ -327,8 +320,8 @@ Private Assert As New Rubberduck.AssertClass
327
320
addTestModuleCommand . Execute ( null ) ;
328
321
329
322
// mock suite auto-assigns "TestModule1" to the first component when we create the mock
330
- var module = vbe . Object . VBProjects [ 0 ] . VBComponents [ "TestModule2" ] . CodeModule ;
331
- Assert . AreEqual ( expected , module . Content ( ) ) ;
323
+ var module = parser . State . DeclarationFinder . FindStdModule ( "TestModule2" ) ;
324
+ Assert . IsTrue ( module . Annotations . Any ( a => a . AnnotationType == AnnotationType . TestModule ) ) ;
332
325
}
333
326
334
327
private Configuration GetUnitTestConfig ( )
You can’t perform that action at this time.
0 commit comments