Skip to content
This repository
Browse code

flush AsLongRunning() and AsPeriodic() in Scheduler.

  • Loading branch information...
commit 81926b98cfa9392af5280aa6c59d0d543d760bef 1 parent 54d5b50
Atsushi Eno authored
24 System.Reactive.Tests/System.Reactive.Concurrency/SchedulerTest.cs
@@ -96,5 +96,29 @@ public void RecursiveActionDateTimeOffset ()
96 96 Assert.AreEqual (10, i, "#1");
97 97 dis.Dispose ();
98 98 }
  99 +
  100 +#if REACTIVE_2_0
  101 + [Test]
  102 + public void AsLongRunning ()
  103 + {
  104 + Assert.IsNull (Scheduler.AsLongRunning (Scheduler.CurrentThread), "#1");
  105 + Assert.IsNotNull (Scheduler.AsLongRunning (Scheduler.Default), "#2");
  106 + Assert.IsNull (Scheduler.AsLongRunning (Scheduler.Immediate), "#3");
  107 + Assert.IsNotNull (Scheduler.AsLongRunning (Scheduler.NewThread), "#4");
  108 + Assert.IsNotNull (Scheduler.AsLongRunning (Scheduler.TaskPool), "#5");
  109 + Assert.IsNotNull (Scheduler.AsLongRunning (Scheduler.ThreadPool), "#6");
  110 + }
  111 +
  112 + [Test]
  113 + public void AsPeriodic ()
  114 + {
  115 + Assert.IsNull (Scheduler.AsPeriodic (Scheduler.CurrentThread), "#1");
  116 + Assert.IsNotNull (Scheduler.AsPeriodic (Scheduler.Default), "#2");
  117 + Assert.IsNull (Scheduler.AsPeriodic (Scheduler.Immediate), "#3");
  118 + Assert.IsNotNull (Scheduler.AsPeriodic (Scheduler.NewThread), "#4");
  119 + Assert.IsNotNull (Scheduler.AsPeriodic (Scheduler.TaskPool), "#5");
  120 + Assert.IsNotNull (Scheduler.AsPeriodic (Scheduler.ThreadPool), "#6");
  121 + }
  122 +#endif
99 123 }
100 124 }
3  System.Reactive.Tests/System.Reactive.PlatformServices/PlatformEnlightenmentProviderTest.cs
@@ -21,6 +21,9 @@ public void Current ()
21 21 #if NET_4_5
22 22 Assert.IsNotNull (pep.GetService<IExceptionServices> (), "#3");
23 23 #endif
  24 + // maybe extraneous, but I attempt to keep compatible way to deal with it...
  25 + Assert.IsNull (pep.GetService<INotifySystemClockChanged> (), "#4");
  26 + Assert.IsNull (pep.GetService<IHostLifecycleNotifications> (), "#5");
24 27 }
25 28 }
26 29 }
6 System.Reactive/System.Reactive.Concurrency/Scheduler.cs
@@ -166,12 +166,14 @@ static void InternalAddTask (IList<ScheduledItem<DateTimeOffset>> tasks, Schedul
166 166 #if REACTIVE_2_0
167 167 public static ISchedulerLongRunning AsLongRunning (this IScheduler scheduler)
168 168 {
169   - throw new NotImplementedException ();
  169 + // is this method really just like this...?
  170 + return scheduler as ISchedulerLongRunning;
170 171 }
171 172
172 173 public static ISchedulerPeriodic AsPeriodic (this IScheduler scheduler)
173 174 {
174   - throw new NotImplementedException ();
  175 + // is this method really just like this...?
  176 + return scheduler as ISchedulerPeriodic;
175 177 }
176 178
177 179 public static IStopwatchProvider AsStopwatchProvider (this IScheduler scheduler)

0 comments on commit 81926b9

Please sign in to comment.
Something went wrong with that request. Please try again.