Bart De Smet 8 年之前
父節點
當前提交
407cc244a0
共有 30 個文件被更改,包括 32 次插入332 次删除
  1. 0 16
      Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs
  2. 1 1
      Rx.NET/Source/src/System.Reactive/Internal/PushPullAdapter.cs
  3. 1 1
      Rx.NET/Source/src/System.Reactive/Internal/ScheduledObserver.cs
  4. 0 33
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Delay.cs
  5. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/GetEnumerator.cs
  6. 0 56
      Rx.NET/Source/src/System.Reactive/Linq/Observable/GroupByUntil.cs
  7. 0 14
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Latest.cs
  8. 0 14
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Next.cs
  9. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Blocking.cs
  10. 0 50
      Rx.NET/Source/tests/Tests.System.Reactive/App.cs
  11. 0 4
      Rx.NET/Source/tests/Tests.System.Reactive/Stress/Core/Schedulers/EventLoop.cs
  12. 0 42
      Rx.NET/Source/tests/Tests.System.Reactive/TestBase.cs
  13. 0 3
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/AsyncLockTest.cs
  14. 0 3
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/CurrentThreadSchedulerTest.cs
  15. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DefaultSchedulerTest.cs
  16. 0 10
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DispatcherSchedulerTest.cs
  17. 1 5
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/EventLoopSchedulerTest.cs
  18. 2 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ImmediateSchedulerTest.cs
  19. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/NewThreadSchedulerTest.cs
  20. 1 3
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SynchronizationContextSchedulerTest.cs
  21. 0 4
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs
  22. 1 1
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/VirtualSchedulerTest.cs
  23. 0 14
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableBlockingTest.cs
  24. 18 22
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableConcurrencyTest.cs
  25. 0 8
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableConversionTests.cs
  26. 0 4
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/QbservableExTest.cs
  27. 0 4
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/QbservableTest.cs
  28. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/ObserverTest.cs
  29. 3 5
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/PrivateTypesTest.cs
  30. 1 4
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/RegressionTest.cs

+ 0 - 16
Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs

@@ -45,11 +45,7 @@ namespace System.Reactive.Concurrency
         /// Semaphore to count requests to re-evaluate the queue, from either Schedule requests or when a timer
         /// expires and moves on to the next item in the queue.
         /// </summary>
-#if !NO_CDS
         private readonly SemaphoreSlim _evt;
-#else
-        private readonly Semaphore _evt;
-#endif
 
         /// <summary>
         /// Queue holding work items. Protected by the gate.
@@ -109,11 +105,7 @@ namespace System.Reactive.Concurrency
 
             _gate = new object();
 
-#if !NO_CDS
             _evt = new SemaphoreSlim(0);
-#else
-            _evt = new Semaphore(0, int.MaxValue);
-#endif
             _queue = new SchedulerQueue<TimeSpan>();
             _readyList = new Queue<ScheduledItem<TimeSpan>>();
 
@@ -281,11 +273,7 @@ namespace System.Reactive.Concurrency
         {
             while (true)
             {
-#if !NO_CDS
                 _evt.Wait();
-#else
-                _evt.WaitOne();
-#endif
 
                 var ready = default(ScheduledItem<TimeSpan>[]);
 
@@ -295,11 +283,7 @@ namespace System.Reactive.Concurrency
                     // Bug fix that ensures the number of calls to Release never greatly exceeds the number of calls to Wait.
                     // See work item #37: https://rx.codeplex.com/workitem/37
                     //
-#if !NO_CDS
                     while (_evt.CurrentCount > 0) _evt.Wait();
-#else
-                    while (_evt.WaitOne(TimeSpan.Zero)) { }
-#endif
 
                     //
                     // The event could have been set by a call to Dispose. This takes priority over anything else. We quit the

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Internal/PushPullAdapter.cs

@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if NO_CDS || NO_PERF
+#if NO_PERF
 using System.Collections.Generic;
 
 namespace System.Reactive

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Internal/ScheduledObserver.cs

@@ -9,7 +9,7 @@ using System.Threading;
 
 namespace System.Reactive
 {
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
     using System.Collections.Concurrent;
     using System.Diagnostics;
 

+ 0 - 33
Rx.NET/Source/src/System.Reactive/Linq/Observable/Delay.cs

@@ -336,14 +336,8 @@ namespace System.Reactive.Linq.ObservableImpl
             private IStopwatch _watch;
 
             private object _gate;
-#if !NO_CDS
             private SemaphoreSlim _evt;
             private CancellationTokenSource _stop;
-#else
-            private Semaphore _evt;
-            private bool _stopped;
-            private ManualResetEvent _stop;
-#endif
             private Queue<System.Reactive.TimeInterval<TSource>> _queue;
             private bool _hasCompleted;
             private TimeSpan _completeAt;
@@ -355,11 +349,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _cancelable = new SerialDisposable();
 
                 _gate = new object();
-#if !NO_CDS
                 _evt = new SemaphoreSlim(0);
-#else
-                _evt = new Semaphore(0, int.MaxValue);
-#endif
                 _queue = new Queue<System.Reactive.TimeInterval<TSource>>();
                 _hasCompleted = false;
                 _completeAt = default(TimeSpan);
@@ -408,18 +398,8 @@ namespace System.Reactive.Linq.ObservableImpl
 
             private void ScheduleDrain()
             {
-#if !NO_CDS
                 _stop = new CancellationTokenSource();
                 _cancelable.Disposable = Disposable.Create(() => _stop.Cancel());
-#else
-                _stop = new ManualResetEvent(false);
-                _cancelable.Disposable = Disposable.Create(() =>
-                {
-                    _stopped = true;
-                    _stop.Set();
-                    _evt.Release();
-                });
-#endif
 
                 _parent._scheduler.AsLongRunning().ScheduleLongRunning(DrainQueue);
             }
@@ -470,7 +450,6 @@ namespace System.Reactive.Linq.ObservableImpl
             {
                 while (true)
                 {
-#if !NO_CDS
                     try
                     {
                         _evt.Wait(_stop.Token);
@@ -479,11 +458,6 @@ namespace System.Reactive.Linq.ObservableImpl
                     {
                         return;
                     }
-#else
-                    _evt.WaitOne();
-                    if (_stopped)
-                        return;
-#endif
 
                     var hasFailed = false;
                     var error = default(Exception);
@@ -535,7 +509,6 @@ namespace System.Reactive.Linq.ObservableImpl
 
                     if (shouldWait)
                     {
-#if !NO_CDS
                         var timer = new ManualResetEventSlim();
                         _parent._scheduler.Schedule(waitTime, () => { timer.Set(); });
 
@@ -547,12 +520,6 @@ namespace System.Reactive.Linq.ObservableImpl
                         {
                             return;
                         }
-#else
-                        var timer = new ManualResetEvent(false);
-                        _parent._scheduler.Schedule(waitTime, () => { timer.Set(); });
-                        if (WaitHandle.WaitAny(new[] { timer, _stop }) == 1)
-                            return;
-#endif
                     }
 
                     if (hasValue)

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/GetEnumerator.cs

@@ -2,7 +2,7 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;

+ 0 - 56
Rx.NET/Source/src/System.Reactive/Linq/Observable/GroupByUntil.cs

@@ -277,7 +277,6 @@ namespace System.Reactive.Linq.ObservableImpl
         }
     }
 
-#if !NO_CDS
     class Map<TKey, TValue>
     {
         // Taken from ConcurrentDictionary in the BCL.
@@ -351,60 +350,5 @@ namespace System.Reactive.Linq.ObservableImpl
             return _map.TryRemove(key, out value);
         }
     }
-#else
-    class Map<TKey, TValue>
-    {
-        private readonly Dictionary<TKey, TValue> _map;
-
-        public Map(int? capacity, IEqualityComparer<TKey> comparer)
-        {
-            if (capacity.HasValue)
-            {
-                _map = new Dictionary<TKey, TValue>(capacity.Value, comparer);
-            }
-            else
-            {
-                _map = new Dictionary<TKey, TValue>(comparer);
-            }
-        }
-
-        public TValue GetOrAdd(TKey key, Func<TValue> valueFactory, out bool added)
-        {
-            lock (_map)
-            {
-                added = false;
-
-                var value = default(TValue);
-                if (!_map.TryGetValue(key, out value))
-                {
-                    value = valueFactory();
-                    _map.Add(key, value);
-                    added = true;
-                }
-
-                return value;
-            }
-        }
-
-        public IEnumerable<TValue> Values
-        {
-            get
-            {
-                lock (_map)
-                {
-                    return _map.Values.ToArray();
-                }
-            }
-        }
-
-        public bool Remove(TKey key)
-        {
-            lock (_map)
-            {
-                return _map.Remove(key);
-            }
-        }
-    }
-#endif
 }
 #endif

+ 0 - 14
Rx.NET/Source/src/System.Reactive/Linq/Observable/Latest.cs

@@ -25,23 +25,13 @@ namespace System.Reactive.Linq.ObservableImpl
         class _ : PushToPullSink<TSource, TSource>
         {
             private readonly object _gate;
-
-#if !NO_CDS
             private readonly SemaphoreSlim _semaphore;
-#else
-            private readonly Semaphore _semaphore;
-#endif
 
             public _(IDisposable subscription)
                 : base(subscription)
             {
                 _gate = new object();
-
-#if !NO_CDS
                 _semaphore = new SemaphoreSlim(0, 1);
-#else
-                _semaphore = new Semaphore(0, 1);
-#endif
             }
 
             private bool _notificationAvailable;
@@ -103,11 +93,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 var value = default(TSource);
                 var error = default(Exception);
 
-#if !NO_CDS
                 _semaphore.Wait();
-#else
-                _semaphore.WaitOne();
-#endif
 
                 lock (_gate)
                 {

+ 0 - 14
Rx.NET/Source/src/System.Reactive/Linq/Observable/Next.cs

@@ -25,23 +25,13 @@ namespace System.Reactive.Linq.ObservableImpl
         class _ : PushToPullSink<TSource, TSource>
         {
             private readonly object _gate;
-
-#if !NO_CDS
             private readonly SemaphoreSlim _semaphore;
-#else
-            private readonly Semaphore _semaphore;
-#endif
 
             public _(IDisposable subscription)
                 : base(subscription)
             {
                 _gate = new object();
-
-#if !NO_CDS
                 _semaphore = new SemaphoreSlim(0, 1);
-#else
-                _semaphore = new Semaphore(0, 1);
-#endif
             }
 
             private bool _waiting;
@@ -117,11 +107,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
                 if (!done)
                 {
-#if !NO_CDS
                     _semaphore.Wait();
-#else
-                    _semaphore.WaitOne();
-#endif
                 }
 
                 //

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Blocking.cs

@@ -256,7 +256,7 @@ namespace System.Reactive.Linq
 
         public virtual IEnumerator<TSource> GetEnumerator<TSource>(IObservable<TSource> source)
         {
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
             var e = new GetEnumerator<TSource>();
             return e.Run(source);
 #else
@@ -459,7 +459,7 @@ namespace System.Reactive.Linq
 
         #region |> Helpers <|
 
-#if NO_CDS || NO_PERF
+#if NO_PERF
         private static IEnumerator<TResult> PushToPull<TSource, TResult>(IObservable<TSource> source, Action<Notification<TSource>> push, Func<Notification<TResult>> pull)
         {
             var subscription = new SingleAssignmentDisposable();

+ 0 - 50
Rx.NET/Source/tests/Tests.System.Reactive/App.cs

@@ -1,50 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the Apache 2.0 License.
-// See the LICENSE file in the project root for more information. 
-
-#if SILVERLIGHT && !SILVERLIGHTM7
-using System;
-using System.Diagnostics;
-using System.Windows;
-using System.Windows.Browser;
-using Microsoft.Silverlight.Testing;
-
-namespace ReactiveTests
-{
-    public class App : Application
-    {
-        public App()
-        {
-            this.Startup += (o, e) =>
-            {
-                // TODO: Investigate UnitTestSettings configuration of TestService and LogProviders.
-                // var settings = new UnitTestSettings { StartRunImmediately = true };
-                RootVisual = UnitTestSystem.CreateTestPage(/* settings */);
-            };
-
-            this.UnhandledException += (o, e) =>
-            {
-                if (!Debugger.IsAttached)
-                {
-                    e.Handled = true;
-                    Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
-                }
-            };
-        }
-
-        private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
-        {
-            try
-            {
-                string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
-                errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
-
-                HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
-            }
-            catch (Exception)
-            {
-            }
-        }
-    }
-}
-#endif

+ 0 - 4
Rx.NET/Source/tests/Tests.System.Reactive/Stress/Core/Schedulers/EventLoop.cs

@@ -58,11 +58,7 @@ namespace ReactiveTests.Stress.Schedulers
 
         private static int CurrentCount(this EventLoopScheduler scheduler)
         {
-#if !NO_CDS
             return ((SemaphoreSlim)semaphore.GetValue(scheduler)).CurrentCount;
-#else
-            return 0;
-#endif
         }
     }
 }

+ 0 - 42
Rx.NET/Source/tests/Tests.System.Reactive/TestBase.cs

@@ -3,51 +3,10 @@
 // See the LICENSE file in the project root for more information. 
 
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Threading;
 
 namespace ReactiveTests
 {
-#if SILVERLIGHT && !SILVERLIGHTM7
-    public class TestBase : Microsoft.Silverlight.Testing.SilverlightTest
-    {
-        public void RunAsync(Action<Waiter> a)
-        {
-            EnqueueCallback(() =>
-            {
-                var w = new Waiter(TestComplete);
-                a(w);
-                w.Wait();
-            });
-        }
-
-        public void CompleteAsync()
-        {
-            EnqueueTestComplete();
-        }
-    }
-
-    public class Waiter
-    {
-        private Action _complete;
-
-        public Waiter(Action complete)
-        {
-            _complete = complete;
-        }
-
-        public void Set()
-        {
-            _complete();
-        }
-
-        public void Wait()
-        {
-        }
-    }
-#else
     public class TestBase
     {
         public void RunAsync(Action<Waiter> a)
@@ -77,5 +36,4 @@ namespace ReactiveTests
     public class AsynchronousAttribute : Attribute
     {
     }
-#endif
 }

+ 0 - 3
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/AsyncLockTest.cs

@@ -2,9 +2,7 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !SILVERLIGHT // MethodAccessException
 using System;
-using System.Threading.Tasks;
 using System.Reactive.Concurrency;
 using System.Reflection;
 using Xunit;
@@ -133,4 +131,3 @@ namespace ReactiveTests.Tests
         }
     }
 }
-#endif

+ 0 - 3
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/CurrentThreadSchedulerTest.cs

@@ -81,8 +81,6 @@ namespace ReactiveTests.Tests
             Assert.True(ran);
         }
 
-#if !SILVERLIGHT
-
         [Fact(Skip ="")]
         public void CurrentThread_ScheduleActionDue()
         {
@@ -114,7 +112,6 @@ namespace ReactiveTests.Tests
             Assert.True(ran, "ran");
             Assert.True(sw.ElapsedMilliseconds > 380, "due " + sw.ElapsedMilliseconds);
         }
-#endif
 #endif
         [Fact]
         public void CurrentThread_EnsureTrampoline()

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DefaultSchedulerTest.cs

@@ -41,7 +41,6 @@ namespace ReactiveTests.Tests
             evt.WaitOne();
         }
 
-#if !SILVERLIGHT
         [Fact]
         public void ScheduleActionDue()
         {
@@ -51,7 +50,6 @@ namespace ReactiveTests.Tests
             nt.Schedule(TimeSpan.FromSeconds(0.2), () => { Assert.NotEqual(id, Thread.CurrentThread.ManagedThreadId); evt.Set(); });
             evt.WaitOne();
         }
-#endif
 
         [Fact]
         public void ScheduleActionCancel()

+ 0 - 10
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DispatcherSchedulerTest.cs

@@ -12,10 +12,6 @@ using System.Windows.Threading;
 using Microsoft.Reactive.Testing;
 using Xunit;
 
-#if SILVERLIGHT && !SILVERLIGHTM7
-using Microsoft.Silverlight.Testing;
-#endif
-
 namespace ReactiveTests.Tests
 {
     
@@ -102,18 +98,13 @@ namespace ReactiveTests.Tests
                 var sch = new DispatcherScheduler(disp);
                 sch.Schedule(() =>
                 {
-#if SILVERLIGHT
-                    Assert.Equal(id, Thread.CurrentThread.ManagedThreadId); // Single-threaded test framework
-#else
                     Assert.NotEqual(id, Thread.CurrentThread.ManagedThreadId);
-#endif
                     disp.InvokeShutdown();
                     evt.Set();
                 });
             });
         }
 
-#if !USE_SL_DISPATCHER
         [Fact]
         public void ScheduleError()
         {
@@ -258,7 +249,6 @@ namespace ReactiveTests.Tests
             evt.WaitOne();
             disp.InvokeShutdown();
         }
-#endif
     }
 }
 #endif

+ 1 - 5
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/EventLoopSchedulerTest.cs

@@ -226,7 +226,6 @@ namespace ReactiveTests.Tests
             Assert.True(ran);
         }
 
-#if !SILVERLIGHT
         [Fact(Skip ="")]
         public void EventLoop_ScheduleActionDue()
         {
@@ -270,7 +269,6 @@ namespace ReactiveTests.Tests
             Assert.True(ran, "ran");
             Assert.True(sw.ElapsedMilliseconds > 380, "due " + sw.ElapsedMilliseconds);
         }
-#endif
 
 #if !NO_PERF
         [Fact]
@@ -280,7 +278,6 @@ namespace ReactiveTests.Tests
         }
 #endif
 
-#if !NO_CDS
         [Fact]
         public void EventLoop_Immediate()
         {
@@ -361,7 +358,6 @@ namespace ReactiveTests.Tests
                 }
             }
         }
-#endif
 
         [Fact]
         public void EventLoop_Periodic()
@@ -393,7 +389,7 @@ namespace ReactiveTests.Tests
         }
 #endif
 
-#if !NO_CDS && DESKTOPCLR
+#if DESKTOPCLR
         [Fact]
         public void EventLoop_CorrectWorkStealing()
         {

+ 2 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ImmediateSchedulerTest.cs

@@ -144,8 +144,8 @@ namespace ReactiveTests.Tests
             });
         }
 
-#if !SILVERLIGHT && !NO_THREAD
-        [Fact(Skip="Ignored")]        
+#if !NO_THREAD
+        [Fact(Skip="Ignored")]
         public void Immediate_ScheduleActionDue()
         {
             var id = Thread.CurrentThread.ManagedThreadId;

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/NewThreadSchedulerTest.cs

@@ -44,7 +44,6 @@ namespace ReactiveTests.Tests
             evt.WaitOne();
         }
 
-#if !SILVERLIGHT
         [Fact(Skip = "")]
         public void NewThread_ScheduleActionDue()
         {
@@ -58,7 +57,6 @@ namespace ReactiveTests.Tests
             Assert.True(sw.ElapsedMilliseconds > 180, "due " + sw.ElapsedMilliseconds);
         }
 #endif
-#endif
 
 #if !NO_PERF
         [Fact]

+ 1 - 3
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SynchronizationContextSchedulerTest.cs

@@ -97,8 +97,7 @@ namespace ReactiveTests.Tests
             Assert.True(ms.Count == 1);
         }
 
-#if !SILVERLIGHT
-        [Fact]        
+        [Fact]
         public void SynchronizationContext_ScheduleActionDue()
         {
             var ms = new MySync();
@@ -112,7 +111,6 @@ namespace ReactiveTests.Tests
             Assert.True(sw.ElapsedMilliseconds > 180, "due " + sw.ElapsedMilliseconds);
             Assert.True(ms.Count == 1);
         }
-#endif
 
         class MySync : SynchronizationContext
         {

+ 0 - 4
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs

@@ -42,7 +42,6 @@ namespace ReactiveTests.Tests
             evt.WaitOne();
         }
 
-#if !NO_CDS
         [Fact]
         public void ProperRooting_NoGC_SingleShot()
         {
@@ -97,9 +96,7 @@ namespace ReactiveTests.Tests
 
             cts.Cancel();
         }
-#endif
 
-#if !SILVERLIGHT
         [Fact]
         public void ScheduleActionDueRelative()
         {
@@ -129,7 +126,6 @@ namespace ReactiveTests.Tests
             nt.Schedule(DateTimeOffset.UtcNow + TimeSpan.FromSeconds(0.2), () => { Assert.NotEqual(id, Thread.CurrentThread.ManagedThreadId); evt.Set(); });
             evt.WaitOne();
         }
-#endif
 
         [Fact]
         public void ScheduleActionCancel()

+ 1 - 1
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/VirtualSchedulerTest.cs

@@ -112,7 +112,7 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => new HistoricalScheduler().ScheduleRelative(42, TimeSpan.FromSeconds(1), default(Func<IScheduler, int, IDisposable>)));
         }
 
-#if !SILVERLIGHT && !NO_THREAD
+#if !NO_THREAD
         [Fact(Skip = "Ignored")]
         public void Virtual_ScheduleActionDue()
         {

+ 0 - 14
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableBlockingTest.cs

@@ -913,20 +913,6 @@ namespace ReactiveTests.Tests
             );
         }
 
-#if DESKTOPCLR20 || SILVERLIGHTM7
-        class Tuple<T1, T2>
-        {
-            public Tuple(T1 item1, T2 item2)
-            {
-                Item1 = item1;
-                Item2 = item2;
-            }
-
-            public T1 Item1 { get; private set; }
-            public T2 Item2 { get; private set; }
-        }
-#endif
-
         #endregion
 
         #region Last

+ 18 - 22
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableConcurrencyTest.cs

@@ -22,16 +22,12 @@ using ReactiveTests.Dummies;
 using System.Windows.Forms;
 #endif
 
-#if SILVERLIGHT && !SILVERLIGHTM7
-using Microsoft.Silverlight.Testing;
-#endif
-
 namespace ReactiveTests.Tests
 {
-    
+
     public partial class ObservableConcurrencyTest : TestBase
     {
-#region + ObserveOn +
+        #region + ObserveOn +
 
         [Fact]
         public void ObserveOn_ArgumentChecking()
@@ -226,9 +222,9 @@ namespace ReactiveTests.Tests
             });
         }
 #endif
-#endregion
+        #endregion
 
-#region SubscribeOn
+        #region SubscribeOn
 
         [Fact]
         public void SubscribeOn_ArgumentChecking()
@@ -426,9 +422,9 @@ namespace ReactiveTests.Tests
             });
         }
 #endif
-#endregion
+        #endregion
 
-#region + Synchronize +
+        #region + Synchronize +
 
         [Fact]
         public void Synchronize_ArgumentChecking()
@@ -539,13 +535,13 @@ namespace ReactiveTests.Tests
             Assert.Equal(Enumerable.Range(0, 200).Sum(), sum);
         }
 #endif
-#endregion
+        #endregion
     }
 
-    
+
     public class ObservableConcurrencyReactiveTest : ReactiveTest
     {
-#region + ObserveOn +
+        #region + ObserveOn +
 
         [Fact]
         public void ObserveOn_Scheduler_ArgumentChecking()
@@ -560,7 +556,7 @@ namespace ReactiveTests.Tests
             var scheduler = new TestScheduler();
 
             var xs = scheduler.CreateHotObservable(
-                OnNext( 90, 1),
+                OnNext(90, 1),
                 OnNext(120, 2),
                 OnNext(230, 3),
                 OnNext(240, 4),
@@ -581,7 +577,7 @@ namespace ReactiveTests.Tests
                 OnCompleted<int>(531)
             );
 
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
             // BREAKING CHANGE v2 > v1.x -> More aggressive disposal behavior
             xs.Subscriptions.AssertEqual(
                 Subscribe(200, 531)
@@ -626,7 +622,7 @@ namespace ReactiveTests.Tests
                 OnError<int>(531, ex)
             );
 
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
             // BREAKING CHANGE v2 > v1.x -> More aggressive disposal behavior
             xs.Subscriptions.AssertEqual(
                 Subscribe(200, 531)
@@ -754,7 +750,7 @@ namespace ReactiveTests.Tests
             }
         }
 
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
         [Fact]
         public void ObserveOn_LongRunning_Simple()
         {
@@ -969,9 +965,9 @@ namespace ReactiveTests.Tests
         }
 #endif
 
-#endregion
+        #endregion
 
-#region SubscribeOn
+        #region SubscribeOn
 
         [Fact]
         public void SubscribeOn_Scheduler_ArgumentChecking()
@@ -1105,9 +1101,9 @@ namespace ReactiveTests.Tests
         }
 #endif
 
-#endregion
+        #endregion
 
-#region |> Helpers <|
+        #region |> Helpers <|
 
 #if !NO_SYNCCTX
         class MyCtx : SynchronizationContext
@@ -1126,6 +1122,6 @@ namespace ReactiveTests.Tests
         }
 #endif
 
-#endregion
+        #endregion
     }
 }

+ 0 - 8
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableConversionTests.cs

@@ -125,7 +125,6 @@ namespace ReactiveTests.Tests
             );
         }
 
-#if !SILVERLIGHTM7
         [Fact]
         public void SubscribeToEnumerable_DefaultScheduler()
         {
@@ -151,7 +150,6 @@ namespace ReactiveTests.Tests
                 results1.AssertEqual(results2);
             }
         }
-#endif
 
         #endregion
 
@@ -485,10 +483,8 @@ namespace ReactiveTests.Tests
             src.OnCompleted();
             Assert.Equal(2, num);
 
-#if !SILVERLIGHT // FieldAccessException
             var tbl = GetSubscriptionTable(evt);
             Assert.True(tbl.Count == 0);
-#endif
         }
 
         [Fact]
@@ -514,10 +510,8 @@ namespace ReactiveTests.Tests
 
             ReactiveAssert.Throws(ex, () => src.OnError(ex));
 
-#if !SILVERLIGHT // FieldAccessException
             var tbl = GetSubscriptionTable(evt);
             Assert.True(tbl.Count == 0);
-#endif
         }
 
         [Fact]
@@ -535,10 +529,8 @@ namespace ReactiveTests.Tests
 
                 Assert.Equal(0, num);
 
-#if !SILVERLIGHT // FieldAccessException
                 var tbl = GetSubscriptionTable(evt);
                 Assert.True(tbl.Count == 0);
-#endif
             }
         }
 

+ 0 - 4
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/QbservableExTest.cs

@@ -2,8 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !SILVERLIGHTM7
-
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -71,5 +69,3 @@ namespace ReactiveTests.Tests
         }
     }
 }
-
-#endif

+ 0 - 4
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/QbservableTest.cs

@@ -3,8 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 #define DEBUG // so that the Debug.WriteLines aren't compiled out
 
-#if !SILVERLIGHTM7
-
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -2150,5 +2148,3 @@ namespace ReactiveTests.Tests
         }
     }
 }
-
-#endif

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/ObserverTest.cs

@@ -643,7 +643,6 @@ namespace ReactiveTests.Tests
             }
         }
 
-#if !NO_CDS
         [Fact]
         public void Observer_Synchronize_OnCompleted()
         {
@@ -720,7 +719,6 @@ namespace ReactiveTests.Tests
 
             Assert.Equal(n, N * M);
         }
-#endif
 
         [Fact]
         public void NotifyOn_Null()

+ 3 - 5
Rx.NET/Source/tests/Tests.System.Reactive/Tests/PrivateTypesTest.cs

@@ -2,17 +2,16 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-#if !SILVERLIGHT // Reflection security restrictions
+using Microsoft.Reactive.Testing;
 using System;
 using System.Linq;
-using Xunit;
-using Microsoft.Reactive.Testing;
 using System.Reactive.Linq;
 using System.Reflection;
+using Xunit;
 
 namespace ReactiveTests.Tests
 {
-    
+
     public partial class PrivateTypesTest : ReactiveTest
     {
         [Fact]
@@ -239,4 +238,3 @@ namespace ReactiveTests.Tests
         }
     }
 }
-#endif

+ 1 - 4
Rx.NET/Source/tests/Tests.System.Reactive/Tests/RegressionTest.cs

@@ -138,7 +138,6 @@ namespace ReactiveTests.Tests
             Assert.True(flag);
         }
 
-#if !SILVERLIGHTM7
 #if !NO_THREAD
         static IEnumerable<int> Bug_1333_Enumerable(AsyncSubject<IDisposable> s, Semaphore sema)
         {
@@ -148,8 +147,7 @@ namespace ReactiveTests.Tests
             t.Join();
             yield return 1;
         }
-#endif
-#if !NO_THREAD
+
         [Fact]
         //[Timeout(1000)]
         public void Bug_1333()
@@ -161,7 +159,6 @@ namespace ReactiveTests.Tests
             d.OnCompleted();
             sema.WaitOne();
         }
-#endif
 #endif
 
         [Fact]