Skip to content

Commit 00794ea

Browse files
committed
TestExplorer fixes
1 parent 3f7c774 commit 00794ea

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

Rubberduck.Core/UI/UnitTesting/TestExplorerControl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@
484484
<Border Grid.Row="0" Grid.RowSpan="3" Background="#FFEEF5FD" />
485485

486486
<ToolBarTray Grid.Row="0" IsLocked="True">
487-
<ToolBar IsEnabled="{Binding Model.IsReady}" Style="{StaticResource ToolBarWithOverflowOnlyShowingWhenNeededStyle}">
487+
<ToolBar Style="{StaticResource ToolBarWithOverflowOnlyShowingWhenNeededStyle}">
488488
<ToolBar.Resources>
489489
<Style TargetType="Image">
490490
<Setter Property="Height" Value="16" />

Rubberduck.Core/UI/UnitTesting/TestExplorerControl.xaml.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System;
2-
using System.Windows.Controls;
32
using System.Windows.Data;
43
using System.Windows.Threading;
5-
using System.Windows.Input;
64

75
namespace Rubberduck.UI.UnitTesting
86
{
@@ -37,9 +35,17 @@ private void OnTestCompleted(object sender, EventArgs eventArgs)
3735
{
3836
_dispatcher.Invoke(() =>
3937
{
40-
if (FindResource("ResultsByOutcome") is CollectionViewSource resource)
38+
if (FindResource("ResultsByOutcome") is CollectionViewSource outcome)
4139
{
42-
resource.View.Refresh();
40+
outcome.View.Refresh();
41+
}
42+
if (FindResource("ResultsByModule") is CollectionViewSource module)
43+
{
44+
module.View.Refresh();
45+
}
46+
if (FindResource("ResultsByCategory") is CollectionViewSource category)
47+
{
48+
category.View.Refresh();
4349
}
4450
});
4551
}

Rubberduck.Core/UI/UnitTesting/TestExplorerViewModel.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ public TestExplorerViewModel(IVBE vbe,
3333
IClipboardWriter clipboard,
3434
IGeneralConfigService configService,
3535
ISettingsFormFactory settingsFormFactory,
36-
IMessageBox messageBox)
36+
IMessageBox messageBox,
37+
ReparseCommand reparseCommand)
3738
{
3839
_vbe = vbe;
3940
_state = state;
@@ -53,7 +54,7 @@ public TestExplorerViewModel(IVBE vbe,
5354
AddTestMethodCommand = new AddTestMethodCommand(vbe, state);
5455
AddErrorTestMethodCommand = new AddTestMethodExpectedErrorCommand(vbe, state);
5556

56-
RefreshCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRefreshCommand, CanExecuteRefreshCommand);
57+
RefreshCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRefreshCommand, o => !Model.IsBusy && reparseCommand.CanExecute(o));
5758
RepeatLastRunCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRepeatLastRunCommand, CanExecuteRepeatLastRunCommand);
5859
RunNotExecutedTestsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRunNotExecutedTestsCommand, CanExecuteRunNotExecutedTestsCommand);
5960
RunInconclusiveTestsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRunInconclusiveTestsCommand, CanExecuteRunInconclusiveTestsCommand);
@@ -261,11 +262,6 @@ private void ExecuteRefreshCommand(object parameter)
261262
SelectedTest = null;
262263
}
263264

264-
private bool CanExecuteRefreshCommand(object parameter)
265-
{
266-
return !Model.IsBusy && _state.IsDirty();
267-
}
268-
269265
private void EnsureRubberduckIsReferencedForEarlyBoundTests()
270266
{
271267
var projectIdsOfMembersUsingAddInLibrary = _state.DeclarationFinder.AllUserDeclarations

Rubberduck.Main/Root/RubberduckIoCInstaller.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Globalization;
4-
using System.IO;
54
using System.Linq;
65
using System.Reflection;
76
using Castle.Facilities.TypedFactory;
@@ -140,7 +139,10 @@ public void Install(IWindsorContainer container, IConfigurationStore store)
140139

141140
RegisterWindowsHooks(container);
142141

143-
RegisterHotkeyFactory(container);
142+
container.Register(Component.For<HotkeyFactory>()
143+
.LifestyleSingleton());
144+
container.Register(Component.For<ITestEngine>().ImplementedBy<TestEngine>()
145+
.LifestyleSingleton());
144146

145147
var assembliesToRegister = AssembliesToRegister().ToArray();
146148

@@ -837,10 +839,5 @@ private void RegisterConstantVbeAndAddIn(IWindsorContainer container)
837839
container.Register(Component.For<IUiContextProvider>().Instance(UiContextProvider.Instance()).LifestyleSingleton());
838840
container.Register(Component.For<IVBEEvents>().Instance(VBEEvents.Initialize(_vbe)).LifestyleSingleton());
839841
}
840-
841-
private void RegisterHotkeyFactory(IWindsorContainer container)
842-
{
843-
container.Register(Component.For<HotkeyFactory>().LifestyleSingleton());
844-
}
845842
}
846843
}

0 commit comments

Comments
 (0)