/
RxAppTest.cs
85 lines (75 loc) · 2.41 KB
/
RxAppTest.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive.Concurrency;
using System.Text;
using ReactiveUI.Xaml;
using Xunit;
namespace ReactiveUI.Tests
{
public class RxAppTest
{
#if !MONO
[Fact]
public void DepPropNotifierShouldBeFound()
{
Assert.True(RxApp.GetAllServices<ICreatesObservableForProperty>()
.Any(x => x is DependencyObjectObservableForProperty));
}
#endif
[Fact]
public void SchedulerShouldBeImmediateInTestRunner()
{
Console.WriteLine(RxApp.DeferredScheduler.GetType().FullName);
Assert.Equal(Scheduler.Immediate, RxApp.DeferredScheduler);
}
[Fact]
public void UnitTestDetectorIdentifiesThisTestAsAnXUnitTest()
{
string[] testAssemblies = new[] {
"CSUNIT",
"NUNIT",
"XUNIT",
"MBUNIT",
"TESTDRIVEN",
"QUALITYTOOLS.TIPS.UNITTEST.ADAPTER",
"QUALITYTOOLS.UNITTESTING.SILVERLIGHT",
"PEX",
"MSBUILD",
"NBEHAVE",
"TESTPLATFORM",
};
string[] designEnvironments = new[] {
"BLEND.EXE",
"MONODEVELOP",
"SHARPDEVELOP.EXE",
};
var isInUnitTestRunner = RealUnitTestDetector.InUnitTestRunner(testAssemblies, designEnvironments);
Assert.True(isInUnitTestRunner);
}
[Fact]
public void UnitTestDetectorDoesNotIdentifyThisTestWhenXUnitAssemblyNotChecked()
{
// XUnit assembly name removed
string[] testAssembliesWithoutNunit = new[] {
"CSUNIT",
"NUNIT",
"MBUNIT",
"TESTDRIVEN",
"QUALITYTOOLS.TIPS.UNITTEST.ADAPTER",
"QUALITYTOOLS.UNITTESTING.SILVERLIGHT",
"PEX",
"MSBUILD",
"NBEHAVE",
"TESTPLATFORM",
};
string[] designEnvironments = new[] {
"BLEND.EXE",
"MONODEVELOP",
"SHARPDEVELOP.EXE",
};
var isInUnitTestRunner = RealUnitTestDetector.InUnitTestRunner(testAssembliesWithoutNunit, designEnvironments);
Assert.False(isInUnitTestRunner);
}
}
}