diff --git a/src/ReactiveUI.Wpf/Registrations.cs b/src/ReactiveUI.Wpf/Registrations.cs index 2867b3522a..5634de399e 100644 --- a/src/ReactiveUI.Wpf/Registrations.cs +++ b/src/ReactiveUI.Wpf/Registrations.cs @@ -20,7 +20,9 @@ public void Register(Action, Type> registerFunction) RxApp.TaskpoolScheduler = TaskPoolScheduler.Default; - RxApp.MainThreadScheduler = new WaitForDispatcherScheduler(() => DispatcherScheduler.Current); + if (!Splat.ModeDetector.InUnitTestRunner()) { + RxApp.MainThreadScheduler = new WaitForDispatcherScheduler(() => DispatcherScheduler.Current); + } } } } diff --git a/src/ReactiveUI/Platforms/net461/PlatformRegistrations.cs b/src/ReactiveUI/Platforms/net461/PlatformRegistrations.cs index 7e840ea570..675e4c0e84 100644 --- a/src/ReactiveUI/Platforms/net461/PlatformRegistrations.cs +++ b/src/ReactiveUI/Platforms/net461/PlatformRegistrations.cs @@ -13,7 +13,10 @@ public void Register(Action, Type> registerFunction) { registerFunction(() => new ComponentModelTypeConverter(), typeof(IBindingTypeConverter)); RxApp.TaskpoolScheduler = TaskPoolScheduler.Default; - RxApp.MainThreadScheduler = DefaultScheduler.Instance; + + if (!Splat.ModeDetector.InUnitTestRunner()) { + RxApp.MainThreadScheduler = DefaultScheduler.Instance; + } } } }