Implement the State Filters and Counts.
This commit is contained in:
@@ -128,23 +128,39 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="Artwork\Passed.ico"
|
||||
Height="16"
|
||||
Margin="3" />
|
||||
<TextBlock Text="0"
|
||||
Margin="3" />
|
||||
<Image Source="Artwork\Failed.ico"
|
||||
Height="16"
|
||||
Margin="3" />
|
||||
<TextBlock Text="0"
|
||||
Margin="3" />
|
||||
<Image Source="Artwork\Skipped.ico"
|
||||
Height="16"
|
||||
Margin="3" />
|
||||
<TextBlock Text="0"
|
||||
Margin="3" />
|
||||
</StackPanel>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<RadioButton IsChecked="{Binding IsPassedFilterChecked}"
|
||||
Margin="3">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="Artwork\Passed.ico"
|
||||
Height="16" />
|
||||
<TextBlock Text="{Binding TestsPassed}" />
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton IsChecked="{Binding IsFailedFilterChecked}"
|
||||
Margin="3"
|
||||
Grid.Column="1">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="Artwork\Failed.ico"
|
||||
Height="16" />
|
||||
<TextBlock Text="{Binding TestsFailed}" />
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
<RadioButton IsChecked="{Binding IsSkippedFilterChecked}"
|
||||
Margin="3"
|
||||
Grid.Column="2">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="Artwork\Skipped.ico"
|
||||
Height="16" />
|
||||
<TextBlock Text="{Binding TestsSkipped}" />
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
</Grid>
|
||||
<ListBox ItemsSource="{Binding TestCases}"
|
||||
SelectionMode="Extended"
|
||||
Grid.Row="1">
|
||||
|
||||
@@ -62,13 +62,34 @@ namespace xunit.runner.wpf.ViewModel
|
||||
private set { Set(ref methodsCaption, value); }
|
||||
}
|
||||
|
||||
private int testsCompleted = -1;
|
||||
private int testsCompleted = 0;
|
||||
public int TestsCompleted
|
||||
{
|
||||
get { return testsCompleted; }
|
||||
set { Set(ref testsCompleted, value); }
|
||||
}
|
||||
|
||||
private int testsPassed = 0;
|
||||
public int TestsPassed
|
||||
{
|
||||
get { return testsPassed; }
|
||||
set { Set(ref testsPassed, value); }
|
||||
}
|
||||
|
||||
private int testsFailed = 0;
|
||||
public int TestsFailed
|
||||
{
|
||||
get { return testsFailed; }
|
||||
set { Set(ref testsFailed, value); }
|
||||
}
|
||||
|
||||
private int testsSkipped = 0;
|
||||
public int TestsSkipped
|
||||
{
|
||||
get { return testsSkipped; }
|
||||
set { Set(ref testsSkipped, value); }
|
||||
}
|
||||
|
||||
private int maximumProgress = int.MaxValue;
|
||||
public int MaximumProgress
|
||||
{
|
||||
@@ -323,6 +344,19 @@ namespace xunit.runner.wpf.ViewModel
|
||||
private void TestRunVisitor_TestFinished(object sender, TestStateEventArgs e)
|
||||
{
|
||||
TestsCompleted++;
|
||||
switch (e.State)
|
||||
{
|
||||
case TestState.Passed:
|
||||
TestsPassed++;
|
||||
break;
|
||||
case TestState.Failed:
|
||||
TestsFailed++;
|
||||
break;
|
||||
case TestState.Skipped:
|
||||
TestsSkipped++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (e.State > CurrentRunState)
|
||||
{
|
||||
CurrentRunState = e.State;
|
||||
@@ -335,6 +369,35 @@ namespace xunit.runner.wpf.ViewModel
|
||||
{
|
||||
this.IsCancelRequested = true;
|
||||
}
|
||||
|
||||
public bool IsPassedFilterChecked
|
||||
{
|
||||
get { return ResultFilter == TestState.Passed; }
|
||||
set { UpdateFilter(value, TestState.Passed); }
|
||||
}
|
||||
|
||||
public bool IsFailedFilterChecked
|
||||
{
|
||||
get { return ResultFilter == TestState.Failed; }
|
||||
set { UpdateFilter(value, TestState.Failed); }
|
||||
}
|
||||
|
||||
public bool IsSkippedFilterChecked
|
||||
{
|
||||
get { return ResultFilter == TestState.Skipped; }
|
||||
set { UpdateFilter(value, TestState.Skipped); }
|
||||
}
|
||||
|
||||
private void UpdateFilter(bool value, TestState newState)
|
||||
{
|
||||
if (value && ResultFilter != newState)
|
||||
{
|
||||
ResultFilter = newState;
|
||||
RaisePropertyChanged(nameof(IsPassedFilterChecked));
|
||||
RaisePropertyChanged(nameof(IsFailedFilterChecked));
|
||||
RaisePropertyChanged(nameof(IsSkippedFilterChecked));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user