Skip to content

Commit 6745681

Browse files
authored
Merge branch 'next' into refactorInspections
2 parents 72d01e8 + f23f935 commit 6745681

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

RetailCoder.VBE/UI/RubberduckUI.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/RubberduckUI.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,6 +1965,9 @@ Would you like to import them to Rubberduck?</value>
19651965
<data name="ConfirmRemoveAssignmentWithUnusedDeclaration" xml:space="preserve">
19661966
<value>Variable '{0}' is assigned. Remove assignment instruction(s)?</value>
19671967
</data>
1968+
<data name="TestExplorer_RunInconclusiveTests" xml:space="preserve">
1969+
<value>Inconclusive Tests</value>
1970+
</data>
19681971
<data name="Assert_DimensionMismatchFormat" xml:space="preserve">
19691972
<value>expected has {0} dimensions; actual has {1} dimensions. {2}</value>
19701973
<comment>{0} and {1} are dimension numbers (1, 2, etc.), {2} = message parameter. This should always be at the end.</comment>

RetailCoder.VBE/UI/UnitTesting/TestExplorerControl.xaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,11 @@
492492
<Image Height="16" Source="../../Resources/question-white.png" />
493493
</MenuItem.Icon>
494494
</MenuItem>
495+
<MenuItem Command="{Binding RunInconclusiveTestsCommand}" Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=TestExplorer_RunInconclusiveTests}" >
496+
<MenuItem.Icon>
497+
<Image Height="16" Source="../../Resources/flask--exclamation.png" />
498+
</MenuItem.Icon>
499+
</MenuItem>
495500
<MenuItem Command="{Binding RunPassedTestsCommand}" Header="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=TestExplorer_RunPassedTests}" >
496501
<MenuItem.Icon>
497502
<Image Height="16" Source="../../Resources/tick-circle.png" />

RetailCoder.VBE/UI/UnitTesting/TestExplorerViewModel.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public TestExplorerViewModel(IVBE vbe,
5454
RefreshCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRefreshCommand, CanExecuteRefreshCommand);
5555
RepeatLastRunCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRepeatLastRunCommand, CanExecuteRepeatLastRunCommand);
5656
RunNotExecutedTestsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRunNotExecutedTestsCommand, CanExecuteRunNotExecutedTestsCommand);
57+
RunInconclusiveTestsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRunInconclusiveTestsCommand, CanExecuteRunInconclusiveTestsCommand);
5758
RunFailedTestsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRunFailedTestsCommand, CanExecuteRunFailedTestsCommand);
5859
RunPassedTestsCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteRunPassedTestsCommand, CanExecuteRunPassedTestsCommand);
5960
RunSelectedTestCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), ExecuteSelectedTestCommand, CanExecuteSelectedTestCommand);
@@ -97,6 +98,11 @@ private bool CanExecuteRunNotExecutedTestsCommand(object obj)
9798
return _vbe.IsInDesignMode && AllowedRunStates.Contains(_state.Status) && Model.Tests.Any(test => test.Result.Outcome == TestOutcome.Unknown);
9899
}
99100

101+
private bool CanExecuteRunInconclusiveTestsCommand(object obj)
102+
{
103+
return _vbe.IsInDesignMode && AllowedRunStates.Contains(_state.Status) & Model.Tests.Any(test => test.Result.Outcome == TestOutcome.Inconclusive);
104+
}
105+
100106
private bool CanExecuteRepeatLastRunCommand(object obj)
101107
{
102108
return _vbe.IsInDesignMode && AllowedRunStates.Contains(_state.Status) && Model.LastRun.Any();
@@ -170,6 +176,8 @@ public bool GroupByLocation
170176

171177
public CommandBase RunNotExecutedTestsCommand { get; }
172178

179+
public CommandBase RunInconclusiveTestsCommand { get; }
180+
173181
public CommandBase RunFailedTestsCommand { get; }
174182

175183
public CommandBase RunPassedTestsCommand { get; }
@@ -256,6 +264,23 @@ private void ExecuteRunNotExecutedTestsCommand(object parameter)
256264
TotalDuration = stopwatch.ElapsedMilliseconds;
257265
}
258266

267+
private void ExecuteRunInconclusiveTestsCommand(object parameter)
268+
{
269+
EnsureRubberduckIsReferencedForEarlyBoundTests();
270+
271+
Model.ClearLastRun();
272+
273+
var stopwatch = new Stopwatch();
274+
Model.IsBusy = true;
275+
276+
stopwatch.Start();
277+
_testEngine.Run(Model.Tests.Where(test => test.Result.Outcome == TestOutcome.Inconclusive));
278+
stopwatch.Stop();
279+
280+
Model.IsBusy = false;
281+
TotalDuration = stopwatch.ElapsedMilliseconds;
282+
}
283+
259284
private void ExecuteRunFailedTestsCommand(object parameter)
260285
{
261286
EnsureRubberduckIsReferencedForEarlyBoundTests();

0 commit comments

Comments
 (0)