357 lines
17 KiB
XML
357 lines
17 KiB
XML
<Window x:Class="xunit.runner.wpf.MainWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:local="clr-namespace:xunit.runner.wpf"
|
|
xmlns:converters="clr-namespace:xunit.runner.wpf.Converters"
|
|
xmlns:vm="clr-namespace:xunit.runner.wpf.ViewModel"
|
|
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
|
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
mc:Ignorable="d"
|
|
DataContext="{Binding Main, Source={StaticResource Locator}}"
|
|
Title="xUnit.net Test Runner"
|
|
Icon="Artwork\Application.ico"
|
|
ResizeMode="CanResizeWithGrip"
|
|
Height="600"
|
|
Width="525"
|
|
Name="Main">
|
|
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="Loaded">
|
|
<cmd:EventToCommand Command="{Binding WindowLoadedCommand}" />
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
|
|
<Window.Resources>
|
|
<converters:TestStateConverter x:Key="TestStateConverter" />
|
|
</Window.Resources>
|
|
|
|
<Grid local:CommandBindings.Registration="{Binding CommandBindings}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Menu Grid.Row="0">
|
|
<MenuItem Header="_File">
|
|
<MenuItem Header="E_xit"
|
|
Command="{Binding ExitCommand}" />
|
|
</MenuItem>
|
|
<MenuItem Header="_Assembly">
|
|
<MenuItem Header="_Open"
|
|
Command="ApplicationCommands.Open" />
|
|
<MenuItem Header="R_ecent" />
|
|
<Separator />
|
|
<MenuItem Header="_Unload" Command="{Binding AssemblyRemoveAllCommand}"/>
|
|
<MenuItem Header="_Reload" Command="{Binding AssemblyReloadAllCommand}" />
|
|
</MenuItem>
|
|
<MenuItem Header="_Project">
|
|
<MenuItem Header="_Open" />
|
|
<MenuItem Header="_Recent" />
|
|
<Separator />
|
|
<MenuItem Header="_Close" />
|
|
<Separator />
|
|
<MenuItem Header="_Save" />
|
|
<MenuItem Header="Save _As..." />
|
|
</MenuItem>
|
|
</Menu>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="2*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<GroupBox Header="Refinements"
|
|
Margin="3"
|
|
Grid.Column="0"
|
|
Grid.Row="0">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<Label Content="Search:"
|
|
Grid.Row="0" />
|
|
<TextBox Grid.Row="1"
|
|
Text="{Binding FilterString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
|
|
|
<Label Content="Assemblies:"
|
|
Grid.Row="2" />
|
|
<ListBox Height="175"
|
|
ItemsSource="{Binding Assemblies}"
|
|
SelectionMode="Extended"
|
|
Grid.Row="3">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate DataType="vm:TestAssemblyViewModel">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="{Binding DisplayName}" />
|
|
|
|
<TextBlock Text=" Discovering tests..."
|
|
FontStyle="Italic"
|
|
Foreground="Gray">
|
|
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock">
|
|
<Setter Property="Visibility" Value="Collapsed" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding State}" Value="{x:Static vm:AssemblyState.Loading}">
|
|
<Setter Property="Visibility" Value="Visible" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
|
|
<ListBox.ItemContainerStyle>
|
|
<Style TargetType="{x:Type ListBoxItem}">
|
|
<Setter Property="IsSelected" Value="{Binding Mode=TwoWay, Path=IsSelected}"/>
|
|
</Style>
|
|
</ListBox.ItemContainerStyle>
|
|
|
|
<ListBox.ContextMenu>
|
|
<ContextMenu>
|
|
<MenuItem Header="Reload" Command="{Binding AssemblyReloadCommand}" />
|
|
<MenuItem Header="Reload All" Command="{Binding AssemblyReloadAllCommand}" />
|
|
<Separator />
|
|
<MenuItem Header="Remove" Command="{Binding AssemblyRemoveCommand}" />
|
|
<MenuItem Header="Remove All" Command="{Binding AssemblyRemoveAllCommand}" />
|
|
</ContextMenu>
|
|
</ListBox.ContextMenu>
|
|
</ListBox>
|
|
|
|
<Label Content="Traits:"
|
|
Grid.Row="4" />
|
|
|
|
<TreeView Grid.Row="5"
|
|
ItemsSource="{Binding Traits}">
|
|
|
|
<TreeView.Resources>
|
|
<HierarchicalDataTemplate DataType="{x:Type vm:TraitViewModel}"
|
|
ItemsSource="{Binding Children}">
|
|
|
|
<CheckBox IsChecked="{Binding IsChecked}" Content="{Binding Text}" >
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="Checked">
|
|
<cmd:EventToCommand Command="{Binding DataContext.TraitCheckedChangedCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
|
CommandParameter="{Binding}" />
|
|
</i:EventTrigger>
|
|
|
|
<i:EventTrigger EventName="Unchecked">
|
|
<cmd:EventToCommand Command="{Binding DataContext.TraitCheckedChangedCommand, RelativeSource={RelativeSource AncestorType=Window}}"
|
|
CommandParameter="{Binding}" />
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</CheckBox>
|
|
|
|
</HierarchicalDataTemplate>
|
|
</TreeView.Resources>
|
|
|
|
<TreeView.ItemContainerStyle>
|
|
<Style TargetType="TreeViewItem">
|
|
<Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
|
|
</Style>
|
|
</TreeView.ItemContainerStyle>
|
|
|
|
<TreeView.ContextMenu>
|
|
<ContextMenu>
|
|
<MenuItem Header="Clear" Command="{Binding TraitsClearCommand}" />
|
|
</ContextMenu>
|
|
</TreeView.ContextMenu>
|
|
|
|
</TreeView>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<Grid Grid.Column="0"
|
|
Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Button Content="_Run All"
|
|
Command="{Binding RunCommand}"
|
|
Margin="3"
|
|
Grid.Column="0" />
|
|
<Button Content="_Cancel"
|
|
Command="{Binding CancelCommand}"
|
|
Margin="0,3,3,3"
|
|
Grid.Column="1" />
|
|
</Grid>
|
|
|
|
<Grid Grid.Column="1"
|
|
Grid.Row="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<GroupBox Header="{Binding TestCasesCaption}"
|
|
Margin="3"
|
|
Grid.Row="0">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
<ToggleButton IsChecked="{Binding IncludePassedTests}"
|
|
BorderThickness="0"
|
|
Background="Transparent"
|
|
Margin="0,4,2,4"
|
|
Grid.Column="0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="Artwork\Passed_large.png" />
|
|
<TextBlock Margin="4,0"
|
|
FontSize="16"
|
|
Text="{Binding TestsPassed, StringFormat={}{0:#\,0}}"
|
|
VerticalAlignment="Center" />
|
|
</StackPanel>
|
|
</ToggleButton>
|
|
|
|
<ToggleButton IsChecked="{Binding IncludeFailedTests}"
|
|
BorderThickness="0"
|
|
Background="Transparent"
|
|
Margin="2,4"
|
|
Grid.Column="1">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="Artwork\Failed_large.png" />
|
|
<TextBlock Margin="4,0"
|
|
FontSize="16"
|
|
Text="{Binding TestsFailed, StringFormat={}{0:#\,0}}"
|
|
VerticalAlignment="Center" />
|
|
</StackPanel>
|
|
</ToggleButton>
|
|
|
|
<ToggleButton IsChecked="{Binding IncludeSkippedTests}"
|
|
BorderThickness="0"
|
|
Background="Transparent"
|
|
Margin="2,4,0,4"
|
|
Grid.Column="2">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="Artwork\Skipped_large.png" />
|
|
<TextBlock Margin="4,0"
|
|
FontSize="16"
|
|
Text="{Binding TestsSkipped, StringFormat={}{0:#\,0}}"
|
|
VerticalAlignment="Center" />
|
|
</StackPanel>
|
|
</ToggleButton>
|
|
</StackPanel>
|
|
|
|
<ListBox ItemsSource="{Binding FilteredTestCases}"
|
|
SelectionMode="Extended"
|
|
Grid.Row="1">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate DataType="vm:TestCaseViewModel">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="20" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Image Width="16"
|
|
Margin="0,0,2,0"
|
|
Source="{Binding Path=State, Mode=OneWay, Converter={StaticResource TestStateConverter}}"
|
|
Grid.Column="0" />
|
|
<TextBlock Text="{Binding DisplayName}"
|
|
VerticalAlignment="Center"
|
|
Grid.Column="1" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<GridSplitter Grid.Row="1" />
|
|
|
|
<GroupBox Header="Output"
|
|
Margin="3"
|
|
Grid.Row="2">
|
|
<TextBox IsReadOnly="True"
|
|
HorizontalScrollBarVisibility="Auto"
|
|
VerticalScrollBarVisibility="Visible"
|
|
FontFamily="Consolas"
|
|
Text="{Binding Output}"/>
|
|
</GroupBox>
|
|
</Grid>
|
|
|
|
<ProgressBar Foreground="{Binding Path=CurrentRunState, Converter={StaticResource TestStateConverter}, Mode=OneWay}"
|
|
Minimum="0"
|
|
Maximum="{Binding MaximumProgress}"
|
|
Value="{Binding Path=TestsCompleted}"
|
|
Grid.Column="1"
|
|
Grid.Row="1"
|
|
Margin="3" />
|
|
</Grid>
|
|
|
|
<StackPanel Grid.Row="2">
|
|
<Border BorderBrush="LightGray"
|
|
BorderThickness="1"
|
|
Margin="3" />
|
|
<StatusBar>
|
|
<StatusBar.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="auto" />
|
|
<ColumnDefinition Width="auto" />
|
|
<ColumnDefinition Width="auto" />
|
|
<ColumnDefinition Width="16"/>
|
|
</Grid.ColumnDefinitions>
|
|
</Grid>
|
|
</ItemsPanelTemplate>
|
|
</StatusBar.ItemsPanel>
|
|
|
|
<StatusBarItem Grid.Column="1">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="Tests passed: "
|
|
Foreground="DarkGreen"/>
|
|
|
|
<TextBlock Text="{Binding TestsPassed, StringFormat={}{0:#\,0}}"/>
|
|
</StackPanel>
|
|
</StatusBarItem>
|
|
|
|
<StatusBarItem Grid.Column="2">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="Tests failed: "
|
|
Foreground="DarkRed"/>
|
|
|
|
<TextBlock Text="{Binding TestsFailed, StringFormat={}{0:#\,0}}"/>
|
|
</StackPanel>
|
|
</StatusBarItem>
|
|
|
|
<StatusBarItem Grid.Column="3">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="Tests skipped: "
|
|
Foreground="DarkGoldenrod"/>
|
|
|
|
<TextBlock Text="{Binding TestsSkipped, StringFormat={}{0:#\,0}}"/>
|
|
</StackPanel>
|
|
</StatusBarItem>
|
|
</StatusBar>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Window>
|