Skip to content

Commit 9586602

Browse files
committed
fixed broken test
1 parent 200c916 commit 9586602

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

RubberduckTests/Commands/UnitTestCommandTests.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using System;
2+
using System.Linq;
23
using System.Threading;
34
using Microsoft.VisualStudio.TestTools.UnitTesting;
45
using Moq;
6+
using Rubberduck.Parsing.Annotations;
57
using Rubberduck.Parsing.VBA;
68
using Rubberduck.Settings;
79
using Rubberduck.UI.Command;
@@ -297,15 +299,6 @@ Private Assert As Object
297299
[TestMethod]
298300
public void AddsTestModule()
299301
{
300-
var expected = @"
301-
Option Explicit
302-
Option Private Module
303-
304-
'@TestModule
305-
Private Assert As New Rubberduck.AssertClass
306-
307-
";
308-
309302
var builder = new MockVbeBuilder();
310303
IVBComponent component;
311304
var vbe = builder.BuildFromSingleStandardModule("", out component);
@@ -327,8 +320,8 @@ Private Assert As New Rubberduck.AssertClass
327320
addTestModuleCommand.Execute(null);
328321

329322
// 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));
332325
}
333326

334327
private Configuration GetUnitTestConfig()

0 commit comments

Comments
 (0)