10 Commits

Author SHA1 Message Date
Matteo Cominetti da4baa6f12 Update azure-pipelines.yml for Azure Pipelines 2020-07-30 14:55:16 +01:00
Matteo Cominetti 81c396dd80 Update azure-pipelines.yml for Azure Pipelines 2020-07-30 14:54:06 +01:00
Matteo Cominetti d12738e609 Merge branch 'master' of github.com:Speckle-Next/xunit.runner.wpf 2020-07-30 14:50:15 +01:00
Matteo Cominetti 2187a6129f bump 2020-07-30 14:49:39 +01:00
Matteo Cominetti 0e2dda20a3 Update azure-pipelines.yml for Azure Pipelines 2020-07-30 14:49:00 +01:00
Matteo Cominetti 39e42e894e bumps version 2020-07-30 14:41:45 +01:00
Matteo Cominetti feecb993dd Update azure-pipelines.yml for Azure Pipelines 2020-07-30 14:39:04 +01:00
Matteo Cominetti c438ba0bc1 Update README.md
added status badge
2020-07-30 14:22:11 +01:00
Matteo Cominetti aba3cf9d92 feat(traits): updated traits selection logic, children with same name no longer selct across different parents 2020-07-13 19:12:34 +01:00
Matteo Cominetti d941a099ca fix(startup-assemblies): check if file exists 2020-07-08 15:13:47 +01:00
7 changed files with 146 additions and 125 deletions
+3
View File
@@ -1,4 +1,7 @@
# xunit.runner.wpf
[![Build Status](https://teocomi.visualstudio.com/Speckle/_apis/build/status/Speckle-Next.speckle.xunit.runner.wpf?branchName=master)](https://teocomi.visualstudio.com/Speckle/_build/latest?definitionId=1&branchName=master)
XUnit Gui written in WPF
Fork of [xunit.runner.wpf](https://www.nuget.org/packages/xunit.runner.wpf).
+3 -3
View File
@@ -11,14 +11,14 @@ namespace SampleTestAssembly
public class Class1
{
[Fact]
//[Trait("TraitName1", "TraitValue1")]
[Trait("TraitName1", "TraitValue1")]
public void Pass()
{
Thread.Sleep(TimeSpan.FromSeconds(1));
}
[Fact]
//[Trait("TraitName1", "TraitValue2")]
[Trait("TraitName1", "TraitValue2")]
public void Fail()
{
Thread.Sleep(TimeSpan.FromSeconds(2));
@@ -26,7 +26,7 @@ namespace SampleTestAssembly
}
[Fact(Skip = "Testing")]
//[Trait("TraitName2", "TraitValue2")]
[Trait("TraitName2", "TraitValue2")]
public void Skip()
{
Thread.Sleep(TimeSpan.FromSeconds(1));
+3 -4
View File
@@ -4,19 +4,18 @@
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
- master
branches:
include:
- refs/tags/*
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
@@ -10,6 +10,7 @@ using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
@@ -253,7 +254,12 @@ namespace Xunit.Runner.Wpf.ViewModel
{
if (StartupAssemblies == null)
return;
var assemblies = StartupAssemblies.Select(x => new AssemblyAndConfigFile(x, configFileName: null));
List<AssemblyAndConfigFile> assemblies = new List<AssemblyAndConfigFile>();
foreach(var assembly in StartupAssemblies)
{
if (File.Exists(assembly))
assemblies.Add(new AssemblyAndConfigFile(assembly, configFileName: null));
}
await AddAssemblies(assemblies);
//await AddAssemblies(ParseCommandLine(Environment.GetCommandLineArgs().Skip(1)));
}
@@ -12,9 +12,9 @@ namespace Xunit.Runner.Wpf.ViewModel
private class TraitViewModelComparer : IEqualityComparer<TraitViewModel>, IComparer<TraitViewModel>
{
public int Compare(TraitViewModel x, TraitViewModel y) => StringComparer.Ordinal.Compare(x.Text, y.Text);
public bool Equals(TraitViewModel x, TraitViewModel y) => StringComparer.Ordinal.Equals(x.Text, y.Text);
public int GetHashCode(TraitViewModel obj) => obj.Text.GetHashCode();
public int Compare(TraitViewModel x, TraitViewModel y) => StringComparer.Ordinal.Compare(x.FullText, y.FullText);
public bool Equals(TraitViewModel x, TraitViewModel y) => StringComparer.Ordinal.Equals(x.FullText, y.FullText);
public int GetHashCode(TraitViewModel obj) => obj.FullText.GetHashCode();
}
}
}
@@ -6,118 +6,129 @@ using Xunit.Runner.Wpf;
namespace Xunit.Runner.Wpf.ViewModel
{
public partial class TraitViewModel : ViewModelBase
public partial class TraitViewModel : ViewModelBase
{
private readonly TraitViewModel _parent;
private bool? _isChecked;
private bool _isExpanded;
private string _text;
public ObservableCollection<TraitViewModel> Children { get; }
public TraitViewModel(string text)
: this(null, text)
{
private readonly TraitViewModel _parent;
private bool? _isChecked;
private bool _isExpanded;
private string _text;
public ObservableCollection<TraitViewModel> Children { get; }
public TraitViewModel(string text)
: this(null, text)
{
}
private TraitViewModel(TraitViewModel parent, string text)
{
this._parent = parent;
this._isChecked = false;
this._isExpanded = true;
this._text = text;
this.Children = new ObservableCollection<TraitViewModel>();
}
private void SetIsChecked(bool? value, bool updateChildren, bool updateParent)
{
if (value == this._isChecked)
{
return;
}
this._isChecked = value;
if (updateChildren && value != null)
{
foreach (var child in this.Children)
{
child.SetIsChecked(value, updateChildren: true, updateParent: false);
}
}
if (updateParent && _parent != null)
{
_parent.VerifyCheckState();
}
this.RaisePropertyChanged(nameof(IsChecked));
}
private void VerifyCheckState()
{
bool? state = null;
var isFirst = true;
foreach (var child in this.Children)
{
if (isFirst)
{
state = child.IsChecked;
isFirst = false;
}
else if (state != child.IsChecked)
{
state = null;
break;
}
}
this.SetIsChecked(state, updateChildren: false, updateParent: true);
}
public void AddValues(IEnumerable<string> values)
{
foreach (var value in values)
{
var index = this.Children.BinarySearch(value, StringComparer.Ordinal.Compare, v => v.Text);
if (index < 0)
{
this.Children.Insert(~index, new TraitViewModel(this, value));
}
}
}
public TraitViewModel GetOrAdd(string text)
{
var index = this.Children.BinarySearch(text, StringComparer.Ordinal, vm => vm.Text);
if (index < 0)
{
var viewModel = new TraitViewModel(this, text);
this.Children.Insert(~index, viewModel);
return viewModel;
}
return this.Children[index];
}
public bool? IsChecked
{
get { return _isChecked; }
set { SetIsChecked(value, updateChildren: true, updateParent: true); }
}
public bool IsExpanded
{
get { return _isExpanded; }
set { Set(ref _isExpanded, value); }
}
public string Text
{
get { return _text; }
set { Set(ref _text, value); }
}
}
private TraitViewModel(TraitViewModel parent, string text)
{
this._parent = parent;
this._isChecked = false;
this._isExpanded = true;
this._text = text;
this.Children = new ObservableCollection<TraitViewModel>();
}
private void SetIsChecked(bool? value, bool updateChildren, bool updateParent)
{
if (value == this._isChecked)
{
return;
}
this._isChecked = value;
if (updateChildren && value != null)
{
foreach (var child in this.Children)
{
child.SetIsChecked(value, updateChildren: true, updateParent: false);
}
}
if (updateParent && _parent != null)
{
_parent.VerifyCheckState();
}
this.RaisePropertyChanged(nameof(IsChecked));
}
private void VerifyCheckState()
{
bool? state = null;
var isFirst = true;
foreach (var child in this.Children)
{
if (isFirst)
{
state = child.IsChecked;
isFirst = false;
}
else if (state != child.IsChecked)
{
state = null;
break;
}
}
this.SetIsChecked(state, updateChildren: false, updateParent: true);
}
public void AddValues(IEnumerable<string> values)
{
foreach (var value in values)
{
var index = this.Children.BinarySearch(value, StringComparer.Ordinal.Compare, v => v.Text);
if (index < 0)
{
this.Children.Insert(~index, new TraitViewModel(this, value));
}
}
}
public TraitViewModel GetOrAdd(string text)
{
var index = this.Children.BinarySearch(text, StringComparer.Ordinal, vm => vm.Text);
if (index < 0)
{
var viewModel = new TraitViewModel(this, text);
this.Children.Insert(~index, viewModel);
return viewModel;
}
return this.Children[index];
}
public bool? IsChecked
{
get { return _isChecked; }
set { SetIsChecked(value, updateChildren: true, updateParent: true); }
}
public bool IsExpanded
{
get { return _isExpanded; }
set { Set(ref _isExpanded, value); }
}
public string Text
{
get { return _text; }
set { Set(ref _text, value); }
}
public string FullText
{
get
{
var fullText = _text;
if (_parent != null)
fullText = _parent.FullText + _text;
return fullText;
}
}
}
}
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
@@ -16,7 +16,9 @@
<PackageIcon></PackageIcon>
<PackageIconUrl>https://avatars2.githubusercontent.com/u/2092016</PackageIconUrl>
<PackageIconUrl>https://avatars2.githubusercontent.com/u/2092016</PackageIconUrl>
<Version>1.0.3</Version>
<Version>1.0.7</Version>
<AssemblyVersion>1.0.7.0</AssemblyVersion>
<FileVersion>1.0.7.0</FileVersion>
</PropertyGroup>
<ItemGroup>