-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestResults.cs
56 lines (51 loc) · 1.77 KB
/
TestResults.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows.Data;
namespace AdventOfCodeScaffolding.Util
{
public enum TestResults
{
None,
NotImplemented,
Failed,
Passed
}
class TestResultsToIconConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return ((TestResults)value) switch
{
TestResults.None => "../Resources/StatusHelp_16x.png",
TestResults.NotImplemented => "../Resources/StatusWarning_16x.png",
TestResults.Failed => "../Resources/StatusInvalid_16x.png",
TestResults.Passed => "../Resources/StatusOK_16x.png",
_ => throw new NotSupportedException(),
};
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
class TestResultsToSummaryConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return ((TestResults)value) switch
{
TestResults.None => "Pending test completion",
TestResults.NotImplemented => "Test is not yet implemented",
TestResults.Failed => "Test failed",
TestResults.Passed => "Test passed",
_ => throw new NotSupportedException(),
};
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
}