소스 검색

Fix xUnit warnings and apply code style fixes to match editorconfig and remove warnings in VS (#626)

Oren Novotny 7 년 전
부모
커밋
379a7519f9

+ 4 - 4
Ix.NET/Source/System.Interactive.Async.Providers/AsyncEnumerableRewriter.cs

@@ -14,7 +14,7 @@ namespace System.Linq
     /// </summary>
     internal class AsyncEnumerableRewriter : ExpressionVisitor
     {
-        private static volatile ILookup<string, MethodInfo> s_methods;
+        private static volatile ILookup<string, MethodInfo> Methods;
 
         protected override Expression VisitConstant(ConstantExpression node)
         {
@@ -394,15 +394,15 @@ namespace System.Linq
             //
             // Ensure the cached lookup table for AsyncEnumerable methods is initialized.
             //
-            if (s_methods == null)
+            if (Methods == null)
             {
-                s_methods = typeof(AsyncEnumerable).GetMethods(BindingFlags.Static | BindingFlags.Public).ToLookup(m => m.Name);
+                Methods = typeof(AsyncEnumerable).GetMethods(BindingFlags.Static | BindingFlags.Public).ToLookup(m => m.Name);
             }
 
             //
             // Find a match based on the method name and the argument types.
             //
-            var method = s_methods[name].FirstOrDefault(m => ArgsMatch(m, args, typeArgs));
+            var method = Methods[name].FirstOrDefault(m => ArgsMatch(m, args, typeArgs));
             if (method == null)
             {
                 throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Could not find method with name '{0}' on type '{1}'.", name, typeof(Enumerable)));

+ 19 - 19
Ix.NET/Source/System.Interactive.Async.Tests/AsyncTests.Aggregates.cs

@@ -1224,8 +1224,8 @@ namespace Tests
             var res = xs.ToLookup(x => x % 2).Result;
             Assert.True(res.Contains(0));
             Assert.True(res.Contains(1));
-            Assert.True(res[0].Contains(4));
-            Assert.True(res[1].Contains(1));
+            Assert.Contains(4, res[0]);
+            Assert.Contains(1, res[1]);
             Assert.True(res.Count == 2);
         }
 
@@ -1236,9 +1236,9 @@ namespace Tests
             var res = xs.ToLookup(x => x % 2).Result;
             Assert.True(res.Contains(0));
             Assert.True(res.Contains(1));
-            Assert.True(res[0].Contains(4));
-            Assert.True(res[0].Contains(2));
-            Assert.True(res[1].Contains(1));
+            Assert.Contains(4, res[0]);
+            Assert.Contains(2, res[0]);
+            Assert.Contains(1, res[1]);
             Assert.True(res.Count == 2);
         }
 
@@ -1249,8 +1249,8 @@ namespace Tests
             var res = xs.ToLookup(x => x % 2, x => x + 1).Result;
             Assert.True(res.Contains(0));
             Assert.True(res.Contains(1));
-            Assert.True(res[0].Contains(5));
-            Assert.True(res[1].Contains(2));
+            Assert.Contains(5, res[0]);
+            Assert.Contains(2, res[1]);
             Assert.True(res.Count == 2);
         }
 
@@ -1261,9 +1261,9 @@ namespace Tests
             var res = xs.ToLookup(x => x % 2, x => x + 1).Result;
             Assert.True(res.Contains(0));
             Assert.True(res.Contains(1));
-            Assert.True(res[0].Contains(5));
-            Assert.True(res[0].Contains(3));
-            Assert.True(res[1].Contains(2));
+            Assert.Contains(5, res[0]);
+            Assert.Contains(3, res[0]);
+            Assert.Contains(2, res[1]);
             Assert.True(res.Count == 2);
         }
 
@@ -1274,8 +1274,8 @@ namespace Tests
             var res = xs.ToLookup(x => x % 2, new Eq()).Result;
             Assert.True(res.Contains(0));
             Assert.True(res.Contains(1));
-            Assert.True(res[0].Contains(4));
-            Assert.True(res[1].Contains(1));
+            Assert.Contains(4, res[0]);
+            Assert.Contains(1, res[1]);
             Assert.True(res.Count == 2);
         }
 
@@ -1286,9 +1286,9 @@ namespace Tests
             var res = xs.ToLookup(x => x % 2, new Eq()).Result;
             Assert.True(res.Contains(0));
             Assert.True(res.Contains(1));
-            Assert.True(res[0].Contains(4));
-            Assert.True(res[0].Contains(2));
-            Assert.True(res[1].Contains(1));
+            Assert.Contains(4, res[0]);
+            Assert.Contains(2, res[0]);
+            Assert.Contains(1, res[1]);
             Assert.True(res.Count == 2);
         }
 
@@ -1319,9 +1319,9 @@ namespace Tests
             var res = xs.ToLookup(x => x % 2, x => x, new Eq()).Result;
             Assert.True(res.Contains(0));
             Assert.True(res.Contains(1));
-            Assert.True(res[0].Contains(4));
-            Assert.True(res[0].Contains(2));
-            Assert.True(res[1].Contains(1));
+            Assert.Contains(4, res[0]);
+            Assert.Contains(2, res[0]);
+            Assert.Contains(1, res[1]);
             Assert.True(res.Count == 2);
         }
 
@@ -2215,4 +2215,4 @@ namespace Tests
             AssertThrows<Exception>(() => xs.Wait(WaitTimeoutMs), ex_ => ((AggregateException)ex_).Flatten().InnerExceptions.Single() == ex);
         }
     }
-}
+}

+ 17 - 17
Ix.NET/Source/System.Interactive.Async.Tests/AsyncTests.Bugs.cs

@@ -215,26 +215,26 @@ namespace Tests
         /// </summary>
         internal sealed class CancellationTestAsyncEnumerable : IAsyncEnumerable<int>
         {
-            private readonly int iterationsBeforeDelay;
+            private readonly int _iterationsBeforeDelay;
 
             public CancellationTestAsyncEnumerable(int iterationsBeforeDelay = 0)
             {
-                this.iterationsBeforeDelay = iterationsBeforeDelay;
+                _iterationsBeforeDelay = iterationsBeforeDelay;
             }
             IAsyncEnumerator<int> IAsyncEnumerable<int>.GetEnumerator() => GetEnumerator();
 
-            public TestEnumerator GetEnumerator() => new TestEnumerator(iterationsBeforeDelay);
+            public TestEnumerator GetEnumerator() => new TestEnumerator(_iterationsBeforeDelay);
 
 
             internal sealed class TestEnumerator : IAsyncEnumerator<int>
             {
-                private readonly int iterationsBeforeDelay;
+                private readonly int _iterationsBeforeDelay;
 
                 public TestEnumerator(int iterationsBeforeDelay)
                 {
-                    this.iterationsBeforeDelay = iterationsBeforeDelay;
+                    _iterationsBeforeDelay = iterationsBeforeDelay;
                 }
-                int i = -1;
+                int _i = -1;
                 public void Dispose()
                 {
                 }
@@ -242,15 +242,15 @@ namespace Tests
                 public CancellationToken LastToken { get; private set; }
                 public bool MoveNextWasCalled { get; private set; }
 
-                public int Current => i;
+                public int Current => _i;
                 
                 public async Task<bool> MoveNext(CancellationToken cancellationToken)
                 {
                     LastToken = cancellationToken;
                     MoveNextWasCalled = true;
                   
-                    i++;
-                    if (Current >= iterationsBeforeDelay)
+                    _i++;
+                    if (Current >= _iterationsBeforeDelay)
                     {
                         await Task.Delay(WaitTimeoutMs, cancellationToken);
                     }
@@ -272,15 +272,15 @@ namespace Tests
 
             private sealed class TestEnumerator : IEnumerator<T>
             {
-                private readonly CancellationTokenSource cancellationTokenSource;
+                private readonly CancellationTokenSource _cancellationTokenSource;
 
                 public TestEnumerator()
                 {
-                    cancellationTokenSource = new CancellationTokenSource();
+                    _cancellationTokenSource = new CancellationTokenSource();
                 }
                 public void Dispose()
                 {
-                    cancellationTokenSource.Cancel();
+                    _cancellationTokenSource.Cancel();
                 }
 
                 public void Reset()
@@ -294,8 +294,8 @@ namespace Tests
 
                 public bool MoveNext()
                 {
-                    Task.Delay(WaitTimeoutMs, cancellationTokenSource.Token).Wait();
-                    cancellationTokenSource.Token.ThrowIfCancellationRequested();
+                    Task.Delay(WaitTimeoutMs, _cancellationTokenSource.Token).Wait();
+                    _cancellationTokenSource.Token.ThrowIfCancellationRequested();
                     return true;
                 }
             }
@@ -371,7 +371,7 @@ namespace Tests
 
             var result = AsyncEnumerable.Return(1).SelectMany(i => disposeCounter).Select(i => i).ToList().Result;
 
-            Assert.Equal(0, result.Count);
+            Assert.Empty(result);
             Assert.Equal(1, disposeCounter.DisposeCount);
         }
 
@@ -382,7 +382,7 @@ namespace Tests
 
             var result = AsyncEnumerable.Range(0, 10).SelectMany(i => disposes[i]).Select(i => i).ToList().Result;
 
-            Assert.Equal(0, result.Count);
+            Assert.Empty(result);
             Assert.True(disposes.All(d => d.DisposeCount == 1));
         }
 
@@ -486,4 +486,4 @@ namespace Tests
         }
 
     }
-}
+}

+ 6 - 6
Ix.NET/Source/System.Interactive.Async.Tests/AsyncTests.Conversions.cs

@@ -265,7 +265,7 @@ namespace Tests
 
         class MyObservable<T> : IObservable<T>
         {
-            private Func<IObserver<T>, IDisposable> _subscribe;
+            private readonly Func<IObserver<T>, IDisposable> _subscribe;
 
             public MyObservable(Func<IObserver<T>, IDisposable> subscribe)
             {
@@ -280,7 +280,7 @@ namespace Tests
 
         class MyDisposable : IDisposable
         {
-            private Action _dispose;
+            private readonly Action _dispose;
 
             public MyDisposable(Action dispose)
             {
@@ -563,9 +563,9 @@ namespace Tests
 
         class MyObserver<T> : IObserver<T>
         {
-            private Action<T> _onNext;
-            private Action<Exception> _onError;
-            private Action _onCompleted;
+            readonly Action<T> _onNext;
+            readonly Action<Exception> _onError;
+            readonly Action _onCompleted;
 
             public MyObserver(Action<T> onNext, Action<Exception> onError, Action onCompleted)
             {
@@ -590,4 +590,4 @@ namespace Tests
             }
         }
     }
-}
+}

+ 2 - 1
Ix.NET/Source/System.Interactive.Async.Tests/AsyncTests.Creation.cs

@@ -461,6 +461,7 @@ namespace Tests
             var en = AsyncEnumerable.CreateEnumerable(() =>
                 AsyncEnumerable.CreateEnumerator(async ct =>
                 {
+                    await Task.Delay(0);
                     return ++count < 3;
                 }
                 , () => 1,
@@ -488,4 +489,4 @@ namespace Tests
             }
         }
     }
-}
+}

+ 3 - 3
Ix.NET/Source/System.Interactive.Async.Tests/AsyncTests.Multiple.cs

@@ -1001,16 +1001,16 @@ namespace Tests
         {
             public bool Equals(CustomerOrder other)
             {
-                if (ReferenceEquals(null, other)) return false;
+                if (other is null) return false;
                 if (ReferenceEquals(this, other)) return true;
                 return OrderId == other.OrderId && string.Equals(CustomerId, other.CustomerId);
             }
 
             public override bool Equals(object obj)
             {
-                if (ReferenceEquals(null, obj)) return false;
+                if (obj is null) return false;
                 if (ReferenceEquals(this, obj)) return true;
-                if (obj.GetType() != this.GetType()) return false;
+                if (obj.GetType() != GetType()) return false;
                 return Equals((CustomerOrder)obj);
             }
 

+ 3 - 3
Ix.NET/Source/System.Interactive.Async.Tests/AsyncTests.Single.cs

@@ -2801,14 +2801,14 @@ namespace Tests
         {
             public bool Equals(Kvp other)
             {
-                if (ReferenceEquals(null, other)) return false;
+                if (other is null) return false;
                 if (ReferenceEquals(this, other)) return true;
                 return string.Equals(Key, other.Key) && Item == other.Item;
             }
 
             public override bool Equals(object obj)
             {
-                if (ReferenceEquals(null, obj)) return false;
+                if (obj is null) return false;
                 if (ReferenceEquals(this, obj)) return true;
                 if (obj.GetType() != GetType()) return false;
                 return Equals((Kvp)obj);
@@ -3508,4 +3508,4 @@ namespace Tests
             NoNext(e);
         }
     }
-}
+}

+ 57 - 58
Ix.NET/Source/System.Interactive.Async/Concatenate.cs

@@ -18,8 +18,7 @@ namespace System.Linq
             if (second == null)
                 throw new ArgumentNullException(nameof(second));
 
-            var concatFirst = first as ConcatAsyncIterator<TSource>;
-            return concatFirst != null ?
+            return first is ConcatAsyncIterator<TSource> concatFirst ?
                        concatFirst.Concat(second) :
                        new Concat2AsyncIterator<TSource>(first, second);
         }
@@ -47,41 +46,41 @@ namespace System.Linq
 
         private sealed class ConcatEnumerableAsyncIterator<TSource> : AsyncIterator<TSource>
         {
-            private readonly IEnumerable<IAsyncEnumerable<TSource>> source;
+            private readonly IEnumerable<IAsyncEnumerable<TSource>> _source;
 
             public ConcatEnumerableAsyncIterator(IEnumerable<IAsyncEnumerable<TSource>> source)
             {
                 Debug.Assert(source != null);
 
-                this.source = source;
+                _source = source;
             }
 
             public override AsyncIterator<TSource> Clone()
             {
-                return new ConcatEnumerableAsyncIterator<TSource>(source);
+                return new ConcatEnumerableAsyncIterator<TSource>(_source);
             }
 
             public override void Dispose()
             {
-                if (outerEnumerator != null)
+                if (_outerEnumerator != null)
                 {
-                    outerEnumerator.Dispose();
-                    outerEnumerator = null;
+                    _outerEnumerator.Dispose();
+                    _outerEnumerator = null;
                 }
 
-                if (currentEnumerator != null)
+                if (_currentEnumerator != null)
                 {
-                    currentEnumerator.Dispose();
-                    currentEnumerator = null;
+                    _currentEnumerator.Dispose();
+                    _currentEnumerator = null;
                 }
 
                 base.Dispose();
             }
 
             // State machine vars
-            private IEnumerator<IAsyncEnumerable<TSource>> outerEnumerator;
-            private IAsyncEnumerator<TSource> currentEnumerator;
-            private int mode;
+            private IEnumerator<IAsyncEnumerable<TSource>> _outerEnumerator;
+            private IAsyncEnumerator<TSource> _currentEnumerator;
+            private int _mode;
 
             const int State_OuterNext = 1;
             const int State_While = 4;
@@ -92,31 +91,31 @@ namespace System.Linq
                 switch (state)
                 {
                     case AsyncIteratorState.Allocated:
-                        outerEnumerator = source.GetEnumerator();
-                        mode = State_OuterNext;
+                        _outerEnumerator = _source.GetEnumerator();
+                        _mode = State_OuterNext;
                         state = AsyncIteratorState.Iterating;
                         goto case AsyncIteratorState.Iterating;
 
                     case AsyncIteratorState.Iterating:
-                        switch (mode)
+                        switch (_mode)
                         {
                             case State_OuterNext:
-                                if (outerEnumerator.MoveNext())
+                                if (_outerEnumerator.MoveNext())
                                 {
                                     // make sure we dispose the previous one if we're about to replace it
-                                    currentEnumerator?.Dispose();
-                                    currentEnumerator = outerEnumerator.Current.GetEnumerator();
+                                    _currentEnumerator?.Dispose();
+                                    _currentEnumerator = _outerEnumerator.Current.GetEnumerator();
                                    
-                                    mode = State_While;
+                                    _mode = State_While;
                                     goto case State_While;
                                 }
 
                                 break;
                             case State_While:
-                                if (await currentEnumerator.MoveNext(cancellationToken)
+                                if (await _currentEnumerator.MoveNext(cancellationToken)
                                                            .ConfigureAwait(false))
                                 {
-                                    current = currentEnumerator.Current;
+                                    current = _currentEnumerator.Current;
                                     return true;
                                 }
 
@@ -135,21 +134,21 @@ namespace System.Linq
 
         private sealed class Concat2AsyncIterator<TSource> : ConcatAsyncIterator<TSource>
         {
-            private readonly IAsyncEnumerable<TSource> first;
-            private readonly IAsyncEnumerable<TSource> second;
+            private readonly IAsyncEnumerable<TSource> _first;
+            private readonly IAsyncEnumerable<TSource> _second;
 
             internal Concat2AsyncIterator(IAsyncEnumerable<TSource> first, IAsyncEnumerable<TSource> second)
             {
                 Debug.Assert(first != null);
                 Debug.Assert(second != null);
 
-                this.first = first;
-                this.second = second;
+                _first = first;
+                _second = second;
             }
 
             public override AsyncIterator<TSource> Clone()
             {
-                return new Concat2AsyncIterator<TSource>(first, second);
+                return new Concat2AsyncIterator<TSource>(_first, _second);
             }
 
             internal override ConcatAsyncIterator<TSource> Concat(IAsyncEnumerable<TSource> next)
@@ -162,9 +161,9 @@ namespace System.Linq
                 switch (index)
                 {
                     case 0:
-                        return first;
+                        return _first;
                     case 1:
-                        return second;
+                        return _second;
                     default:
                         return null;
                 }
@@ -173,8 +172,8 @@ namespace System.Linq
 
         private abstract class ConcatAsyncIterator<TSource> : AsyncIterator<TSource>, IIListProvider<TSource>
         {
-            private int counter;
-            private IAsyncEnumerator<TSource> enumerator;
+            private int _counter;
+            private IAsyncEnumerator<TSource> _enumerator;
 
             public Task<TSource[]> ToArrayAsync(CancellationToken cancellationToken)
             {
@@ -231,10 +230,10 @@ namespace System.Linq
 
             public override void Dispose()
             {
-                if (enumerator != null)
+                if (_enumerator != null)
                 {
-                    enumerator.Dispose();
-                    enumerator = null;
+                    _enumerator.Dispose();
+                    _enumerator = null;
                 }
 
                 base.Dispose();
@@ -244,29 +243,29 @@ namespace System.Linq
             {
                 if (state == AsyncIteratorState.Allocated)
                 {
-                    enumerator = GetAsyncEnumerable(0)
+                    _enumerator = GetAsyncEnumerable(0)
                         .GetEnumerator();
                     state = AsyncIteratorState.Iterating;
-                    counter = 2;
+                    _counter = 2;
                 }
 
                 if (state == AsyncIteratorState.Iterating)
                 {
                     while (true)
                     {
-                        if (await enumerator.MoveNext(cancellationToken)
+                        if (await _enumerator.MoveNext(cancellationToken)
                                             .ConfigureAwait(false))
                         {
-                            current = enumerator.Current;
+                            current = _enumerator.Current;
                             return true;
                         }
                         // note, this is simply to match the logic of 
                         // https://github.com/dotnet/corefx/blob/ec2685715b01d12f16b08d0dfa326649b12db8ec/src/system.linq/src/system/linq/concatenate.cs#L173-L173
-                        var next = GetAsyncEnumerable(counter++ - 1);
+                        var next = GetAsyncEnumerable(_counter++ - 1);
                         if (next != null)
                         {
-                            enumerator.Dispose();
-                            enumerator = next.GetEnumerator();
+                            _enumerator.Dispose();
+                            _enumerator = next.GetEnumerator();
                             continue;
                         }
 
@@ -291,9 +290,9 @@ namespace System.Linq
         // a much better memory profile and without much additional run-time cost.
         private sealed class ConcatNAsyncIterator<TSource> : ConcatAsyncIterator<TSource>
         {
-            private readonly IAsyncEnumerable<TSource> next;
-            private readonly int nextIndex;
-            private readonly ConcatAsyncIterator<TSource> previousConcat;
+            private readonly IAsyncEnumerable<TSource> _next;
+            private readonly int _nextIndex;
+            private readonly ConcatAsyncIterator<TSource> _previousConcat;
 
             internal ConcatNAsyncIterator(ConcatAsyncIterator<TSource> previousConcat, IAsyncEnumerable<TSource> next, int nextIndex)
             {
@@ -301,19 +300,19 @@ namespace System.Linq
                 Debug.Assert(next != null);
                 Debug.Assert(nextIndex >= 2);
 
-                this.previousConcat = previousConcat;
-                this.next = next;
-                this.nextIndex = nextIndex;
+                _previousConcat = previousConcat;
+                _next = next;
+                _nextIndex = nextIndex;
             }
 
             public override AsyncIterator<TSource> Clone()
             {
-                return new ConcatNAsyncIterator<TSource>(previousConcat, next, nextIndex);
+                return new ConcatNAsyncIterator<TSource>(_previousConcat, _next, _nextIndex);
             }
 
             internal override ConcatAsyncIterator<TSource> Concat(IAsyncEnumerable<TSource> next)
             {
-                if (nextIndex == int.MaxValue - 2)
+                if (_nextIndex == int.MaxValue - 2)
                 {
                     // In the unlikely case of this many concatenations, if we produced a ConcatNIterator
                     // with int.MaxValue then state would overflow before it matched it's index.
@@ -321,12 +320,12 @@ namespace System.Linq
                     return new Concat2AsyncIterator<TSource>(this, next);
                 }
 
-                return new ConcatNAsyncIterator<TSource>(this, next, nextIndex + 1);
+                return new ConcatNAsyncIterator<TSource>(this, next, _nextIndex + 1);
             }
 
             internal override IAsyncEnumerable<TSource> GetAsyncEnumerable(int index)
             {
-                if (index > nextIndex)
+                if (index > _nextIndex)
                 {
                     return null;
                 }
@@ -338,22 +337,22 @@ namespace System.Linq
                 var current = this;
                 while (true)
                 {
-                    if (index == current.nextIndex)
+                    if (index == current._nextIndex)
                     {
-                        return current.next;
+                        return current._next;
                     }
 
-                    if (current.previousConcat is ConcatNAsyncIterator<TSource> prevN)
+                    if (current._previousConcat is ConcatNAsyncIterator<TSource> prevN)
                     {
                         current = prevN;
                         continue;
                     }
 
-                    Debug.Assert(current.previousConcat is Concat2AsyncIterator<TSource>);
+                    Debug.Assert(current._previousConcat is Concat2AsyncIterator<TSource>);
                     Debug.Assert(index == 0 || index == 1);
-                    return current.previousConcat.GetAsyncEnumerable(index);
+                    return current._previousConcat.GetAsyncEnumerable(index);
                 }
             }
         }
     }
-}
+}

+ 6 - 7
Ix.NET/Source/System.Interactive.Async/ToObservable.cs

@@ -172,20 +172,19 @@ namespace System.Linq
 
         private class ToObservableObservable<T> : IObservable<T>
         {
-            private readonly IAsyncEnumerable<T> source;
+            private readonly IAsyncEnumerable<T> _source;
 
             public ToObservableObservable(IAsyncEnumerable<T> source)
             {
-                this.source = source;
+                _source = source;
             }
 
             public IDisposable Subscribe(IObserver<T> observer)
             {
                 var ctd = new CancellationTokenDisposable();
-                var e = source.GetEnumerator();
+                var e = _source.GetEnumerator();
 
-                var f = default(Action);
-                f = () => e.MoveNext(ctd.Token)
+                void f() => e.MoveNext(ctd.Token)
                            .ContinueWith(t =>
                                          {
                                              if (t.IsFaulted)
@@ -205,7 +204,7 @@ namespace System.Linq
 
                                                      if (!ctd.Token.IsCancellationRequested)
                                                          f();
-                                                     
+
                                                      //In case cancellation is requested, this could only have happened
                                                      //by disposing the returned composite disposable (see below).
                                                      //In that case, e will be disposed too, so there is no need to dispose e here.
@@ -224,4 +223,4 @@ namespace System.Linq
             }
         }
     }
-}
+}

+ 2 - 2
Ix.NET/Source/System.Interactive.Tests/Tests.Buffering.cs

@@ -550,12 +550,12 @@ namespace Tests
             Assert.True(rnd.Zip(rnd, (l, r) => l == r).All(x => x));
         }
 
-        static Random s_rand = new Random();
+        static Random Random = new Random();
 
         static IEnumerable<int> Rand()
         {
             while (true)
-                yield return s_rand.Next();
+                yield return Random.Next();
         }
 
         [Fact]

+ 4 - 4
Ix.NET/Source/System.Interactive.Tests/Tests.Qbservable.cs

@@ -35,7 +35,7 @@ namespace Tests
                         select new { Name = o.Key, Enumerable = o.ToList(), Queryable = q.ToList() })
                        .ToList();
 
-            Func<Type, bool> filterReturn = t =>
+            bool filterReturn(Type t)
             {
                 if (t.GetTypeInfo().IsGenericType)
                 {
@@ -44,12 +44,12 @@ namespace Tests
                         return false;
                 }
                 return true;
-            };
+            }
 
-            Func<MethodInfo, bool> filterHelper = m =>
+            bool filterHelper(MethodInfo m)
             {
                 return !m.IsDefined(typeof(EditorBrowsableAttribute), false);
-            };
+            }
 
             foreach (var group in mtch)
             {

+ 1 - 1
Ix.NET/Source/System.Interactive.Tests/Tests.Single.cs

@@ -93,7 +93,7 @@ namespace Tests
             var rng = Enumerable.Empty<int>();
 
             var res = rng.Buffer(5).ToList();
-            Assert.Equal(0, res.Count);
+            Assert.Empty(res);
         }
 
         [Fact]