412c9b78fe
Fixes a crash when attempting to run the StyleCop Analyzers test suite.
42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Collections.Immutable;
|
|
using GalaSoft.MvvmLight;
|
|
using Xunit.Runner.Data;
|
|
|
|
namespace Xunit.Runner.Wpf.ViewModel
|
|
{
|
|
public class TestCaseViewModel : ViewModelBase
|
|
{
|
|
private TestState _state = TestState.NotRun;
|
|
|
|
public string DisplayName { get; }
|
|
public string UniqueID { get; }
|
|
public string SkipReason { get; }
|
|
public string AssemblyFileName { get; }
|
|
public ImmutableArray<TraitViewModel> Traits { get; }
|
|
public bool IsSelected { get; set; }
|
|
|
|
public bool HasSkipReason => !string.IsNullOrEmpty(this.SkipReason);
|
|
|
|
public TestState State
|
|
{
|
|
get { return _state; }
|
|
set { Set(ref _state, value); }
|
|
}
|
|
|
|
public TestCaseViewModel(string displayName, string uniqueID, string skipReason, string assemblyFileName, IEnumerable<TraitViewModel> traits)
|
|
{
|
|
this.DisplayName = displayName;
|
|
this.UniqueID = uniqueID;
|
|
this.SkipReason = skipReason;
|
|
this.AssemblyFileName = assemblyFileName;
|
|
this.Traits = traits.ToImmutableArray();
|
|
|
|
if (!string.IsNullOrEmpty(skipReason))
|
|
{
|
|
_state = TestState.Skipped;
|
|
}
|
|
}
|
|
}
|
|
}
|