11
11
xmlns : converters =" clr-namespace:Rubberduck.UI.Converters"
12
12
Language =" {UICulture}"
13
13
mc : Ignorable =" d"
14
- d : DesignHeight =" 255 " d : DesignWidth =" 455 "
14
+ d : DesignHeight =" 400 " d : DesignWidth =" 600 "
15
15
d : DataContext =" {d:DesignInstance local:TestExplorerViewModel}" >
16
16
17
17
<UserControl .Resources>
47
47
48
48
<local : TestOutcomeImageSourceConverter x : Key =" OutcomeIconConverter" />
49
49
<BooleanToVisibilityConverter x : Key =" BoolToVisibility" />
50
- <converters : BoolToHiddenVisibilityConverter x : Key =" BoolToCollapsed" />
50
+ <converters : MillisecondToTimeMagnitudeConverter x : Key =" FormattedTime" />
51
+ <converters : InvertBoolValueConverter x : Key =" InvertBoolValue" />
51
52
52
53
<SolidColorBrush x : Key =" ToolBarToggleButtonVerticalBackground" Color =" Transparent" />
53
54
<SolidColorBrush x : Key =" ToolBarButtonHover" Color =" #210080FF" />
246
247
</Trigger >
247
248
</Style .Triggers>
248
249
</Style >
250
+
249
251
</UserControl .Resources>
250
252
251
253
<Grid >
252
254
<Grid .RowDefinitions>
253
255
<RowDefinition Height =" 30" />
254
256
<RowDefinition Height =" 10" />
257
+ <RowDefinition Height =" Auto" />
255
258
<RowDefinition Height =" *" />
256
259
</Grid .RowDefinitions>
257
260
279
282
<Separator />
280
283
281
284
<Menu Background =" Transparent" >
282
- <MenuItem VerticalAlignment =" Center" Header =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_RunMenuButtonText}" >
285
+ <MenuItem VerticalAlignment =" Center" Header =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_RunMenuButtonText}"
286
+ IsEnabled =" {Binding Model.IsBusy, Converter={StaticResource InvertBoolValue}}" >
283
287
<MenuItem .Icon>
284
288
<Image Source =" {StaticResource RunImage}" Style =" {StaticResource ToolbarImageOpacity}" />
285
289
</MenuItem .Icon>
343
347
<Separator />
344
348
345
349
<Menu Background =" Transparent" >
346
- <MenuItem VerticalAlignment =" Center" Header =" {Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=Add}" >
350
+ <MenuItem VerticalAlignment =" Center" Header =" {Resx ResxName=Rubberduck.Resources.RubberduckUI, Key=Add}"
351
+ IsEnabled =" {Binding Model.IsBusy, Converter={StaticResource InvertBoolValue}}" >
347
352
<MenuItem .Icon>
348
353
<Image Source =" {StaticResource AddIcon}" Style =" {StaticResource ToolbarImageOpacity}" />
349
354
</MenuItem .Icon>
426
431
</ProgressBar >
427
432
428
433
<Border Grid.Row=" 2" Padding =" 2" >
434
+ <StackPanel Orientation =" Horizontal" >
435
+ <StackPanel .Resources>
436
+ <converters : NonZeroToVisibilityConverter x : Key =" NonZeroToVisibility" />
437
+ <BitmapImage x : Key =" IgnoredTestImage" UriSource =" pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/minus-white.png" />
438
+ <BitmapImage x : Key =" InconclusiveTestImage" UriSource =" pack://application:,,,/Rubberduck.Resources;component/Icons/Fugue/exclamation.png" />
439
+ <Style x : Key =" ResultsTestOutcomeStyle" TargetType =" TextBlock" >
440
+ <Setter Property =" Margin" Value =" 4,0,12,0" />
441
+ <Setter Property =" TextWrapping" Value =" WrapWithOverflow" />
442
+ <Setter Property =" VerticalAlignment" Value =" Center" />
443
+ </Style >
444
+ <Style x : Key =" TestOutcomeIconStyle" TargetType =" Image" >
445
+ <Setter Property =" Height" Value =" 16" />
446
+ <Setter Property =" Width" Value =" 16" />
447
+ <Setter Property =" VerticalAlignment" Value =" Center" />
448
+ <Setter Property =" Margin" Value =" 3" />
449
+ </Style >
450
+ </StackPanel .Resources>
451
+ <TextBlock Margin =" 2" Padding =" 4,2,4,2" FontWeight =" Bold" VerticalAlignment =" Center"
452
+ Text =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestOutcome_SummaryCaption}" />
453
+ <TextBlock Style =" {StaticResource ResultsTestOutcomeStyle}" Text =" {Binding Model.LastTestRunSummary, Mode=OneWay}" />
454
+ <StackPanel Orientation =" Horizontal" Visibility =" {Binding Model.LastTestFailedCount, Mode=OneWay, Converter={StaticResource NonZeroToVisibility}}" >
455
+ <Image Style =" {StaticResource TestOutcomeIconStyle}" Source =" {StaticResource RunFailedTestsImage}" Margin =" 4,0,4,0" />
456
+ <TextBlock Style =" {StaticResource ResultsTestOutcomeStyle}" >
457
+ <Run Text =" {Binding Model.LastTestFailedCount, Mode=OneWay}" />
458
+ <Run Text =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestOutcome_Failed}" />
459
+ </TextBlock >
460
+ </StackPanel >
461
+ <StackPanel Orientation =" Horizontal" Visibility =" {Binding Model.LastTestIgnoredCount, Mode=OneWay, Converter={StaticResource NonZeroToVisibility}}" >
462
+ <Image Style =" {StaticResource TestOutcomeIconStyle}" Source =" {StaticResource IgnoredTestImage}" />
463
+ <TextBlock Style =" {StaticResource ResultsTestOutcomeStyle}" >
464
+ <Run Text =" {Binding Model.LastTestIgnoredCount, Mode=OneWay}" />
465
+ <Run Text =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestOutcome_Ignored}" />
466
+ </TextBlock >
467
+ </StackPanel >
468
+ <StackPanel Orientation =" Horizontal" Visibility =" {Binding Model.LastTestInconclusiveCount, Mode=OneWay, Converter={StaticResource NonZeroToVisibility}}" >
469
+ <Image Style =" {StaticResource TestOutcomeIconStyle}" Source =" {StaticResource InconclusiveTestImage}" />
470
+ <TextBlock Style =" {StaticResource ResultsTestOutcomeStyle}" >
471
+ <Run Text =" {Binding Model.LastTestInconclusiveCount, Mode=OneWay}" />
472
+ <Run Text =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestOutcome_Inconclusive}" />
473
+ </TextBlock >
474
+ </StackPanel >
475
+ <StackPanel Orientation =" Horizontal" Visibility =" {Binding Model.LastTestSucceededCount, Mode=OneWay, Converter={StaticResource NonZeroToVisibility}}" >
476
+ <Image Style =" {StaticResource TestOutcomeIconStyle}" Source =" {StaticResource RunPassedTestsImage}" />
477
+ <TextBlock Style =" {StaticResource ResultsTestOutcomeStyle}" >
478
+ <Run Text =" {Binding Model.LastTestSucceededCount, Mode=OneWay}" />
479
+ <Run Text =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestOutcome_Succeeded}" />
480
+ </TextBlock >
481
+ </StackPanel >
482
+ </StackPanel >
483
+ </Border >
484
+
485
+ <Border Grid.Row=" 3" Padding =" 2" >
429
486
<Grid >
430
487
<controls : GroupingGrid x : Name =" TestGrid"
431
488
ItemsSource =" {Binding Tests}"
432
489
SelectionMode =" Extended"
433
- ShowGroupingItemCount =" True" >
490
+ ShowGroupingItemCount =" True"
491
+ InitialExpandedState =" True" >
434
492
<DataGrid .Columns>
435
493
<DataGridTemplateColumn Header =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_Outcome}" >
436
494
<DataGridTemplateColumn .CellTemplate>
454
512
<DataGridTemplateColumn Header =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_QualifiedModuleName}" >
455
513
<DataGridTemplateColumn .CellTemplate>
456
514
<DataTemplate DataType =" vm:TestMethodViewModel" >
457
- <TextBlock Text =" {Binding Method.Declaration.QualifiedModuleName}" />
515
+ <TextBlock Text =" {Binding Method.Declaration.QualifiedModuleName}" Margin = " 0,0,4,0 " />
458
516
</DataTemplate >
459
517
</DataGridTemplateColumn .CellTemplate>
460
518
</DataGridTemplateColumn >
461
519
<DataGridTemplateColumn Header =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_MethodName}" >
462
520
<DataGridTemplateColumn .CellTemplate>
463
521
<DataTemplate DataType =" vm:TestMethodViewModel" >
464
- <TextBlock Text =" {Binding Method.Declaration.IdentifierName}" />
522
+ <TextBlock Text =" {Binding Method.Declaration.IdentifierName}" Margin = " 0,0,4,0 " />
465
523
</DataTemplate >
466
524
</DataGridTemplateColumn .CellTemplate>
467
525
</DataGridTemplateColumn >
468
526
<DataGridTemplateColumn Header =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_CategoryName}" >
469
527
<DataGridTemplateColumn .CellTemplate>
470
528
<DataTemplate DataType =" vm:TestMethodViewModel" >
471
- <TextBlock Text =" {Binding Method.Category.Name}" />
529
+ <TextBlock Text =" {Binding Method.Category.Name}" Margin = " 0,0,4,0 " />
472
530
</DataTemplate >
473
531
</DataGridTemplateColumn .CellTemplate>
474
532
</DataGridTemplateColumn >
475
533
<DataGridTemplateColumn Header =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_Message}" >
476
534
<DataGridTemplateColumn .CellTemplate>
477
535
<DataTemplate DataType =" vm:TestMethodViewModel" >
478
- <TextBlock Text =" {Binding Result.Output}" />
536
+ <TextBlock Text =" {Binding Result.Output}" Margin = " 0,0,4,0 " />
479
537
</DataTemplate >
480
538
</DataGridTemplateColumn .CellTemplate>
481
539
</DataGridTemplateColumn >
482
540
<DataGridTemplateColumn Header =" {Resx ResxName=Rubberduck.Resources.UnitTesting.TestExplorer, Key=TestExplorer_Duration}" >
483
541
<DataGridTemplateColumn .CellTemplate>
484
542
<DataTemplate DataType =" vm:TestMethodViewModel" >
485
- <TextBlock Text =" {Binding Result.Duration, StringFormat={}{0}ms} " />
543
+ <TextBlock Text =" {Binding Result.Duration, Converter={StaticResource FormattedTime}} " TextAlignment = " Right " Margin = " 0,0,4,0 " />
486
544
</DataTemplate >
487
545
</DataGridTemplateColumn .CellTemplate>
488
546
</DataGridTemplateColumn >
523
581
</controls : GroupingGrid >
524
582
</Grid >
525
583
</Border >
526
- <controls : BusyIndicator Grid.Row=" 2 " Width =" 120" Height =" 120" Visibility =" {Binding Model.IsBusy , Converter={StaticResource BoolToVisibility}}" />
584
+ <controls : BusyIndicator Grid.Row=" 3 " Width =" 120" Height =" 120" Visibility =" {Binding Model.IsRefreshing , Converter={StaticResource BoolToVisibility}}" />
527
585
</Grid >
528
586
</UserControl >
0 commit comments