Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

flush AsLongRunning() and AsPeriodic() in Scheduler.

  • Loading branch information...
commit 81926b98cfa9392af5280aa6c59d0d543d760bef 1 parent 54d5b50
@atsushieno authored
View
24 System.Reactive.Tests/System.Reactive.Concurrency/SchedulerTest.cs
@@ -96,5 +96,29 @@ public void RecursiveActionDateTimeOffset ()
Assert.AreEqual (10, i, "#1");
dis.Dispose ();
}
+
+#if REACTIVE_2_0
+ [Test]
+ public void AsLongRunning ()
+ {
+ Assert.IsNull (Scheduler.AsLongRunning (Scheduler.CurrentThread), "#1");
+ Assert.IsNotNull (Scheduler.AsLongRunning (Scheduler.Default), "#2");
+ Assert.IsNull (Scheduler.AsLongRunning (Scheduler.Immediate), "#3");
+ Assert.IsNotNull (Scheduler.AsLongRunning (Scheduler.NewThread), "#4");
+ Assert.IsNotNull (Scheduler.AsLongRunning (Scheduler.TaskPool), "#5");
+ Assert.IsNotNull (Scheduler.AsLongRunning (Scheduler.ThreadPool), "#6");
+ }
+
+ [Test]
+ public void AsPeriodic ()
+ {
+ Assert.IsNull (Scheduler.AsPeriodic (Scheduler.CurrentThread), "#1");
+ Assert.IsNotNull (Scheduler.AsPeriodic (Scheduler.Default), "#2");
+ Assert.IsNull (Scheduler.AsPeriodic (Scheduler.Immediate), "#3");
+ Assert.IsNotNull (Scheduler.AsPeriodic (Scheduler.NewThread), "#4");
+ Assert.IsNotNull (Scheduler.AsPeriodic (Scheduler.TaskPool), "#5");
+ Assert.IsNotNull (Scheduler.AsPeriodic (Scheduler.ThreadPool), "#6");
+ }
+#endif
}
}
View
3  System.Reactive.Tests/System.Reactive.PlatformServices/PlatformEnlightenmentProviderTest.cs
@@ -21,6 +21,9 @@ public void Current ()
#if NET_4_5
Assert.IsNotNull (pep.GetService<IExceptionServices> (), "#3");
#endif
+ // maybe extraneous, but I attempt to keep compatible way to deal with it...
+ Assert.IsNull (pep.GetService<INotifySystemClockChanged> (), "#4");
+ Assert.IsNull (pep.GetService<IHostLifecycleNotifications> (), "#5");
}
}
}
View
6 System.Reactive/System.Reactive.Concurrency/Scheduler.cs
@@ -166,12 +166,14 @@ static void InternalAddTask (IList<ScheduledItem<DateTimeOffset>> tasks, Schedul
#if REACTIVE_2_0
public static ISchedulerLongRunning AsLongRunning (this IScheduler scheduler)
{
- throw new NotImplementedException ();
+ // is this method really just like this...?
+ return scheduler as ISchedulerLongRunning;
}
public static ISchedulerPeriodic AsPeriodic (this IScheduler scheduler)
{
- throw new NotImplementedException ();
+ // is this method really just like this...?
+ return scheduler as ISchedulerPeriodic;
}
public static IStopwatchProvider AsStopwatchProvider (this IScheduler scheduler)
Please sign in to comment.
Something went wrong with that request. Please try again.