Skip to content

Commit 8ee7774

Browse files
authored
Merge pull request #4367 from Vogel612/unit-testing-hotfix
hotfixes for unit-testing
2 parents 6cc9ec6 + 532fa46 commit 8ee7774

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Rubberduck.Main/Root/RubberduckIoCInstaller.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ public void Install(IWindsorContainer container, IConfigurationStore store)
123123

124124
container.Register(Component.For<TestExplorerModel>()
125125
.LifestyleSingleton());
126-
container.Register(Component.For<VBEInteraction>().LifestyleSingleton());
126+
container.Register(Component.For<IVBEInteraction>()
127+
.ImplementedBy<VBEInteraction>()
128+
.LifestyleSingleton());
127129

128130
RegisterRefactoringDialogs(container);
129131

Rubberduck.UnitTesting/UnitTesting/TestEngine.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ internal class TestEngine : ITestEngine
3737
private readonly List<TestMethod> LastRun = new List<TestMethod>();
3838
private readonly Dictionary<TestOutcome, List<TestMethod>> resultsByOutcome = new Dictionary<TestOutcome, List<TestMethod>>();
3939
public IEnumerable<TestMethod> Tests { get; private set; }
40-
public bool CanRun => !_vbe.IsInDesignMode && AllowedRunStates.Contains(_state.Status);
40+
public bool CanRun => AllowedRunStates.Contains(_state.Status);// && !_vbe.IsInDesignMode;
4141
public bool CanRepeatLastRun => LastRun.Any();
4242

4343
private bool refreshBackoff;
@@ -126,7 +126,7 @@ public void RepeatLastRun()
126126

127127
private void RunInternal(IEnumerable<TestMethod> tests)
128128
{
129-
if (!CanRun)
129+
if (!CanRun || _vbe.IsInDesignMode)
130130
{
131131
return;
132132
}

0 commit comments

Comments
 (0)