浏览代码

Merge branch 'master' into TimeoutCancelLoser

David Karnok 6 年之前
父节点
当前提交
d20c94e292
共有 100 个文件被更改,包括 587 次插入3487 次删除
  1. 0 8
      .editorconfig
  2. 0 4
      .github/release-drafter.yml
  3. 5 3
      Ix.NET/Source/AsyncQueryableGenerator.t4
  4. 1 1
      Ix.NET/Source/Benchmarks.System.Interactive/Benchmarks.System.Interactive.csproj
  5. 1 2
      Ix.NET/Source/Benchmarks.System.Interactive/BufferCountBenchmark.cs
  6. 4 5
      Ix.NET/Source/Benchmarks.System.Interactive/IgnoreElementsBenchmark.cs
  7. 1 2
      Ix.NET/Source/Benchmarks.System.Interactive/MinMaxBenchmark.cs
  8. 1 1
      Ix.NET/Source/Benchmarks.System.Interactive/Program.cs
  9. 7 25
      Ix.NET/Source/CodeCoverage.runsettings
  10. 6 3
      Ix.NET/Source/Directory.build.props
  11. 0 8
      Ix.NET/Source/Directory.build.targets
  12. 3 1
      Ix.NET/Source/FasterLinq/Program.cs
  13. 0 11
      Ix.NET/Source/NuGet.config
  14. 1 1
      Ix.NET/Source/System.Interactive.Async.Providers.Tests/AssertEx.cs
  15. 2 4
      Ix.NET/Source/System.Interactive.Async.Providers.Tests/System.Interactive.Async.Providers.Tests.csproj
  16. 0 5
      Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.csproj
  17. 201 201
      Ix.NET/Source/System.Interactive.Async.Providers/System/Linq/AsyncQueryableEx.Generated.cs
  18. 4 4
      Ix.NET/Source/System.Interactive.Async.Tests/AsyncTests.Bugs.cs
  19. 4 10
      Ix.NET/Source/System.Interactive.Async.Tests/System.Interactive.Async.Tests.csproj
  20. 1 2
      Ix.NET/Source/System.Interactive.Async.Tests/System/Linq/Operators/Never.cs
  21. 0 1
      Ix.NET/Source/System.Interactive.Async/System.Interactive.Async.csproj
  22. 0 10
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Distinct.cs
  23. 1 1
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Never.cs
  24. 0 3
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/OnErrorResumeNext.cs
  25. 1 4
      Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Timeout.cs
  26. 1 1
      Ix.NET/Source/System.Interactive.Providers/System/Linq/QueryableEx.cs
  27. 1 1
      Ix.NET/Source/System.Interactive.Tests/AssertEx.cs
  28. 0 88
      Ix.NET/Source/System.Interactive.Tests/BufferTest.cs
  29. 0 89
      Ix.NET/Source/System.Interactive.Tests/CaseTest.cs
  30. 0 210
      Ix.NET/Source/System.Interactive.Tests/CatchTest.cs
  31. 0 63
      Ix.NET/Source/System.Interactive.Tests/ConcatTest.cs
  32. 0 119
      Ix.NET/Source/System.Interactive.Tests/CreateTest.cs
  33. 0 53
      Ix.NET/Source/System.Interactive.Tests/DeferTest.cs
  34. 0 52
      Ix.NET/Source/System.Interactive.Tests/DistinctTest.cs
  35. 0 42
      Ix.NET/Source/System.Interactive.Tests/DistinctUntilChangedTest.cs
  36. 0 103
      Ix.NET/Source/System.Interactive.Tests/DoTest.cs
  37. 0 38
      Ix.NET/Source/System.Interactive.Tests/DoWhileTest.cs
  38. 0 43
      Ix.NET/Source/System.Interactive.Tests/ExpandTest.cs
  39. 0 86
      Ix.NET/Source/System.Interactive.Tests/FinallyTest.cs
  40. 0 40
      Ix.NET/Source/System.Interactive.Tests/ForEachTest.cs
  41. 0 27
      Ix.NET/Source/System.Interactive.Tests/ForTest.cs
  42. 0 30
      Ix.NET/Source/System.Interactive.Tests/GenerateTest.cs
  43. 0 30
      Ix.NET/Source/System.Interactive.Tests/HideTest.cs
  44. 0 49
      Ix.NET/Source/System.Interactive.Tests/IfTest.cs
  45. 0 29
      Ix.NET/Source/System.Interactive.Tests/IgnoreElementsTest.cs
  46. 0 33
      Ix.NET/Source/System.Interactive.Tests/IsEmptyTest.cs
  47. 0 36
      Ix.NET/Source/System.Interactive.Tests/MaxByTest.cs
  48. 0 36
      Ix.NET/Source/System.Interactive.Tests/MaxTest.cs
  49. 0 273
      Ix.NET/Source/System.Interactive.Tests/MemoizeTest.cs
  50. 0 38
      Ix.NET/Source/System.Interactive.Tests/MinByTest.cs
  51. 0 36
      Ix.NET/Source/System.Interactive.Tests/MinTest.cs
  52. 0 23
      Ix.NET/Source/System.Interactive.Tests/NopObserver.cs
  53. 0 86
      Ix.NET/Source/System.Interactive.Tests/OnErrorResumeNextTest.cs
  54. 0 284
      Ix.NET/Source/System.Interactive.Tests/PublishTest.cs
  55. 0 163
      Ix.NET/Source/System.Interactive.Tests/QueryableParityTest.cs
  56. 0 55
      Ix.NET/Source/System.Interactive.Tests/RepeatTest.cs
  57. 0 55
      Ix.NET/Source/System.Interactive.Tests/RetryTest.cs
  58. 0 21
      Ix.NET/Source/System.Interactive.Tests/ReturnTest.cs
  59. 0 36
      Ix.NET/Source/System.Interactive.Tests/ScanTest.cs
  60. 0 27
      Ix.NET/Source/System.Interactive.Tests/SelectManyTest.cs
  61. 0 125
      Ix.NET/Source/System.Interactive.Tests/ShareTest.cs
  62. 0 58
      Ix.NET/Source/System.Interactive.Tests/SkipLastTest.cs
  63. 0 38
      Ix.NET/Source/System.Interactive.Tests/StartWithTest.cs
  64. 3 5
      Ix.NET/Source/System.Interactive.Tests/System.Interactive.Tests.csproj
  65. 1 1
      Ix.NET/Source/System.Interactive.Tests/System/Linq/Operators/Publish.cs
  66. 6 6
      Ix.NET/Source/System.Interactive.Tests/System/Linq/Operators/Using.cs
  67. 0 73
      Ix.NET/Source/System.Interactive.Tests/TakeLastTest.cs
  68. 0 31
      Ix.NET/Source/System.Interactive.Tests/ThrowTest.cs
  69. 0 75
      Ix.NET/Source/System.Interactive.Tests/UsingTest.cs
  70. 0 38
      Ix.NET/Source/System.Interactive.Tests/WhileTest.cs
  71. 2 2
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Catch.cs
  72. 1 1
      Ix.NET/Source/System.Interactive/System/Linq/Operators/DistinctUntilChanged.cs
  73. 1 1
      Ix.NET/Source/System.Interactive/System/Linq/Operators/IgnoreElements.cs
  74. 8 9
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Memoize.cs
  75. 1 1
      Ix.NET/Source/System.Interactive/System/Linq/Operators/OnErrorResumeNext.cs
  76. 9 10
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Publish.cs
  77. 1 1
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Scan.cs
  78. 8 5
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Share.cs
  79. 9 3
      Ix.NET/Source/System.Interactive/System/Linq/RefCountList.cs
  80. 7 3
      Ix.NET/Source/System.Interactive/System/Linq/Yielder.cs
  81. 1 1
      Ix.NET/Source/System.Linq.Async.Queryable.Tests/AssertEx.cs
  82. 3 8
      Ix.NET/Source/System.Linq.Async.Queryable.Tests/System.Linq.Async.Queryable.Tests.csproj
  83. 0 1
      Ix.NET/Source/System.Linq.Async.Queryable/System.Linq.Async.Queryable.csproj
  84. 1 1
      Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncEnumerableQuery.cs
  85. 14 8
      Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncEnumerableRewriter.cs
  86. 197 197
      Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncQueryable.Generated.cs
  87. 2 2
      Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncQueryable.cs
  88. 4 10
      Ix.NET/Source/System.Linq.Async.Tests/System.Linq.Async.Tests.csproj
  89. 3 3
      Ix.NET/Source/System.Linq.Async.Tests/System/Linq/AsyncEnumerableNamingTests.cs
  90. 1 1
      Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/GroupBy.cs
  91. 4 4
      Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/Join.cs
  92. 8 8
      Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/ToAsyncEnumerable.cs
  93. 5 2
      Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/ToLookup.cs
  94. 18 9
      Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/ToObservable.cs
  95. 2 6
      Ix.NET/Source/System.Linq.Async/System.Linq.Async.csproj
  96. 16 16
      Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.AsyncOverloads.cs
  97. 4 2
      Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.AsyncOverloads.tt
  98. 0 3
      Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerablePartition.cs
  99. 0 3
      Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerator.cs
  100. 1 1
      Ix.NET/Source/System.Linq.Async/System/Linq/AsyncListPartition.cs

+ 0 - 8
.editorconfig

@@ -252,11 +252,3 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
 csharp_space_between_method_declaration_parameter_list_parentheses = false
 csharp_space_between_method_declaration_parameter_list_parentheses = false
 csharp_space_between_parentheses = false
 csharp_space_between_parentheses = false
 csharp_space_between_square_brackets = false
 csharp_space_between_square_brackets = false
-
-
-
-
-
-
-
-

+ 0 - 4
.github/release-drafter.yml

@@ -1,4 +0,0 @@
-template: |
-  ## What's Changed
-
-  $CHANGES

+ 5 - 3
Ix.NET/Source/AsyncQueryableGenerator.t4

@@ -174,7 +174,7 @@ foreach (var m in asyncEnumerableType.GetMethods()
     {
     {
         infoName += "__" + string.Join("_", genArgs.Select(a => a.Name));
         infoName += "__" + string.Join("_", genArgs.Select(a => a.Name));
         infoTypeArgs = "(" + string.Join(", ", genArgs.Select(a => "Type " + a.Name)) + ")";
         infoTypeArgs = "(" + string.Join(", ", genArgs.Select(a => "Type " + a.Name)) + ")";
-        infoToGeneric = ".GetGenericMethodDefinition()";
+        infoToGeneric = "!.GetGenericMethodDefinition()";
         infoMakeGeneric = ".MakeGenericMethod(" + string.Join(", ", genArgs.Select(a => a.Name)) + ")";
         infoMakeGeneric = ".MakeGenericMethod(" + string.Join(", ", genArgs.Select(a => a.Name)) + ")";
         infoGenArgs = "<" + string.Join(", ", genArgs.Select(_ => "object")) + ">";
         infoGenArgs = "<" + string.Join(", ", genArgs.Select(_ => "object")) + ">";
     }
     }
@@ -281,14 +281,16 @@ foreach (var m in asyncEnumerableType.GetMethods()
     }
     }
 
 
     var expr = "Expression.Call(" + mtd + ", " + string.Join(", ", quotedArgs) + ")";
     var expr = "Expression.Call(" + mtd + ", " + string.Join(", ", quotedArgs) + ")";
+
+    var cons = name.StartsWith("ToDictionary") ? " where TKey : notnull" : "";
 #>
 #>
-        private static MethodInfo s_<#=infoName#>;
+        private static MethodInfo? s_<#=infoName#>;
         
         
         private static MethodInfo <#=infoName#><#=infoTypeArgs#> =>
         private static MethodInfo <#=infoName#><#=infoTypeArgs#> =>
             (s_<#=infoName#> ??
             (s_<#=infoName#> ??
             (s_<#=infoName#> = new Func<<#=infoSignature#>>(<#=m.Name#><#=infoGenArgs#>).GetMethodInfo()<#=infoToGeneric#>))<#=infoMakeGeneric#>;
             (s_<#=infoName#> = new Func<<#=infoSignature#>>(<#=m.Name#><#=infoGenArgs#>).GetMethodInfo()<#=infoToGeneric#>))<#=infoMakeGeneric#>;
 
 
-        public static <#=ret#> <#=name#>(<#=pars#>)
+        public static <#=ret#> <#=name#>(<#=pars#>)<#=cons#>
         {
         {
 <#
 <#
 var any = false;
 var any = false;

+ 1 - 1
Ix.NET/Source/Benchmarks.System.Interactive/Benchmarks.System.Interactive.csproj

@@ -20,7 +20,7 @@
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
+    <PackageReference Include="BenchmarkDotNet" Version="0.12.0" />
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup Condition="'$(Configuration)|$(Platform)'=='Ix.net 3.1.1|AnyCPU'">
   <ItemGroup Condition="'$(Configuration)|$(Platform)'=='Ix.net 3.1.1|AnyCPU'">

+ 1 - 2
Ix.NET/Source/Benchmarks.System.Interactive/BufferCountBenchmark.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // 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.
 // See the LICENSE file in the project root for more information.
 
 
-using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Threading;
 using System.Threading;
@@ -15,7 +14,7 @@ namespace Benchmarks.System.Interactive
     {
     {
         [Params(1, 10, 100, 1000, 10000, 100000, 1000000)]
         [Params(1, 10, 100, 1000, 10000, 100000, 1000000)]
         public int N;
         public int N;
-        private IList<int> _store;
+        private IList<int>? _store;
 
 
         [Benchmark]
         [Benchmark]
         public void Exact()
         public void Exact()

+ 4 - 5
Ix.NET/Source/Benchmarks.System.Interactive/IgnoreElementsBenchmark.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // 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.
 // See the LICENSE file in the project root for more information.
 
 
-using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Threading;
 using System.Threading;
@@ -18,8 +17,8 @@ namespace Benchmarks.System.Interactive
 
 
         private int _store;
         private int _store;
 
 
-        private int[] _array;
-        private List<int> _list;
+        private int[]? _array;
+        private List<int>? _list;
 
 
         [Benchmark]
         [Benchmark]
         public void Ignore()
         public void Ignore()
@@ -32,7 +31,7 @@ namespace Benchmarks.System.Interactive
         [Benchmark]
         [Benchmark]
         public void IgnoreList()
         public void IgnoreList()
         {
         {
-            _list
+            _list!
                 .IgnoreElements()
                 .IgnoreElements()
                 .Subscribe(v => Volatile.Write(ref _store, v));
                 .Subscribe(v => Volatile.Write(ref _store, v));
         }
         }
@@ -40,7 +39,7 @@ namespace Benchmarks.System.Interactive
         [Benchmark]
         [Benchmark]
         public void IgnoreArray()
         public void IgnoreArray()
         {
         {
-            _array
+            _array!
                 .IgnoreElements()
                 .IgnoreElements()
                 .Subscribe(v => Volatile.Write(ref _store, v));
                 .Subscribe(v => Volatile.Write(ref _store, v));
         }
         }

+ 1 - 2
Ix.NET/Source/Benchmarks.System.Interactive/MinMaxBenchmark.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // 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.
 // See the LICENSE file in the project root for more information.
 
 
-using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
 using System.Threading;
 using System.Threading;
@@ -16,7 +15,7 @@ namespace Benchmarks.System.Interactive
         [Params(1, 10, 100, 1000, 10000, 100000, 1000000)]
         [Params(1, 10, 100, 1000, 10000, 100000, 1000000)]
         public int N;
         public int N;
         private int _store;
         private int _store;
-        private IList<int> _listStore;
+        private IList<int>? _listStore;
 
 
         private readonly IComparer<int> _comparer = Comparer<int>.Default;
         private readonly IComparer<int> _comparer = Comparer<int>.Default;
 
 

+ 1 - 1
Ix.NET/Source/Benchmarks.System.Interactive/Program.cs

@@ -10,7 +10,7 @@ namespace Benchmarks.System.Interactive
 {
 {
     internal class Program
     internal class Program
     {
     {
-        internal static void Main(string[] args)
+        internal static void Main()
         {
         {
             Console.WriteLine("Effective Ix-version: " + typeof(EnumerableEx).Assembly.GetName().Version);
             Console.WriteLine("Effective Ix-version: " + typeof(EnumerableEx).Assembly.GetName().Version);
 
 

+ 7 - 25
Ix.NET/Source/CodeCoverage.runsettings

@@ -2,33 +2,15 @@
 <!-- File name extension must be .runsettings -->
 <!-- File name extension must be .runsettings -->
 <RunSettings>
 <RunSettings>
   <DataCollectionRunSettings>
   <DataCollectionRunSettings>
-    <DataCollectors>
-      <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <DataCollectors>      
+       <DataCollector friendlyName="XPlat code coverage">
         <Configuration>
         <Configuration>
-          <CodeCoverage>
-
-            <!--  
-About include/exclude lists:  
-Empty "Include" clauses imply all; empty "Exclude" clauses imply none.  
-Each element in the list is a regular expression (ECMAScript syntax). See http://msdn.microsoft.com/library/2k3te2cs.aspx.  
-An item must first match at least one entry in the include list to be included.  
-Included items must then not match any entries in the exclude list to remain included.  
--->
-
-            <!-- Match assembly file paths: -->
-            <ModulePaths>
-              <Include>
-                <ModulePath>.*Interactive.*</ModulePath>
-                <ModulePath>.*System.Linq.Async.dll$</ModulePath>
-              </Include>
-              <Exclude>
-                <ModulePath>.*Tests.dll$</ModulePath>
-              </Exclude>
-            </ModulePaths>
-
-          </CodeCoverage>
+          <Format>cobertura</Format>
+          <Exclude>[xunit.*]*,[*Tests]*</Exclude> <!-- [Assembly-Filter]Type-Filter -->
+          <ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
+          <SingleHit>false</SingleHit>
         </Configuration>
         </Configuration>
-      </DataCollector>
+      </DataCollector>    
     </DataCollectors>
     </DataCollectors>
   </DataCollectionRunSettings>
   </DataCollectionRunSettings>
 </RunSettings>
 </RunSettings>

+ 6 - 3
Ix.NET/Source/Directory.build.props

@@ -18,17 +18,20 @@
     <PublishRepositoryUrl>true</PublishRepositoryUrl>
     <PublishRepositoryUrl>true</PublishRepositoryUrl>
     <!-- While in beta, we need to set preview for 8.0 manually (rather than latest). -->
     <!-- While in beta, we need to set preview for 8.0 manually (rather than latest). -->
     <LangVersion>preview</LangVersion>
     <LangVersion>preview</LangVersion>
+    <Nullable>enable</Nullable>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
-    <PackageReference Include="Nerdbank.GitVersioning" Version="2.3.138" PrivateAssets="all" />
+    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19554-01" PrivateAssets="All"/>
+    <PackageReference Include="Nerdbank.GitVersioning" Version="3.0.26" PrivateAssets="all" />
   </ItemGroup>
   </ItemGroup>
 
 
+
   <ItemGroup Condition="'$(IsTestProject)' == 'true'">
   <ItemGroup Condition="'$(IsTestProject)' == 'true'">
-    <PackageReference Include="coverlet.msbuild" Version="2.5.1" />
+    <PackageReference Include="coverlet.collector" Version="1.1.0" />
   </ItemGroup>
   </ItemGroup>
 
 
+
   <Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
   <Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
     <ItemGroup>
     <ItemGroup>
       <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
       <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">

+ 0 - 8
Ix.NET/Source/Directory.build.targets

@@ -20,13 +20,5 @@
   <PropertyGroup>
   <PropertyGroup>
     <Product>$(AssemblyName) ($(TargetFramework))</Product>
     <Product>$(AssemblyName) ($(TargetFramework))</Product>
   </PropertyGroup>
   </PropertyGroup>
-  
-  <PropertyGroup Condition="'$(IsTestProject)' == 'true'">
-    <UseSourceLink>true</UseSourceLink>
-    <CoverletOutputFormat>cobertura</CoverletOutputFormat>
-    <Exclude>[xunit.*]*</Exclude>
-    <CoverletOutput>$(MSBuildThisFileDirectory)coverlet/raw/$(AssemblyName)/$(TargetFramework)/</CoverletOutput>
-    <CollectCoverage Condition="'$(TF_BUILD)' == 'true'">true</CollectCoverage>
-  </PropertyGroup>
 
 
 </Project>
 </Project>

+ 3 - 1
Ix.NET/Source/FasterLinq/Program.cs

@@ -1,7 +1,9 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // 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. 
 // See the LICENSE file in the project root for more information. 
 
 
+#nullable disable
+
 using System;
 using System;
 using System.Collections;
 using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Generic;

+ 0 - 11
Ix.NET/Source/NuGet.config

@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
-  <packageSources>    
-    <add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
-    <add key="dotnet-windowsdesktop" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
-    <add key="aspnet-aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
-    <add key="aspnet-aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
-    <add key="aspnet-entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
-    <add key="aspnet-extensions" value="https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json" />
-  </packageSources>
-</configuration>

+ 1 - 1
Ix.NET/Source/System.Interactive.Async.Providers.Tests/AssertEx.cs

@@ -36,7 +36,7 @@ namespace Tests
             }
             }
             catch (AggregateException ex)
             catch (AggregateException ex)
             {
             {
-                var inner = ex.Flatten().InnerException;
+                _ = ex.Flatten().InnerException;
 
 
                 // TODO: proper assert; unfortunately there's not always a good call stack
                 // TODO: proper assert; unfortunately there's not always a good call stack
             }
             }

+ 2 - 4
Ix.NET/Source/System.Interactive.Async.Providers.Tests/System.Interactive.Async.Providers.Tests.csproj

@@ -5,7 +5,6 @@
     <NoWarn>$(NoWarn);CS0618</NoWarn>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
   </PropertyGroup>
   </PropertyGroup>
 
 
-
   <ItemGroup>
   <ItemGroup>
     <Content Include="xunit.runner.json">
     <Content Include="xunit.runner.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -18,13 +17,12 @@
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
       <PrivateAssets>all</PrivateAssets>
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
     </PackageReference>
-    <PackageReference Include="FluentAssertions" Version="5.6.0" />
-
+    <PackageReference Include="FluentAssertions" Version="5.9.0" />
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="xunit" Version="2.4.1" />
   </ItemGroup>
   </ItemGroup>
 
 

+ 0 - 5
Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.csproj

@@ -5,7 +5,6 @@
     <AssemblyTitle>Interactive Extensions - Async Providers Library</AssemblyTitle>
     <AssemblyTitle>Interactive Extensions - Async Providers Library</AssemblyTitle>
     <TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
     <TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
     <PackageTags>Ix;Interactive;Extensions;Enumerable;Asynchronous</PackageTags>
     <PackageTags>Ix;Interactive;Extensions;Enumerable;Asynchronous</PackageTags>
-    <NullableContextOptions>enable</NullableContextOptions>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
@@ -22,8 +21,4 @@
     <Compile Update="System\Linq\AsyncQueryableEx.Generated.cs" DesignTime="True" AutoGen="True" DependentUpon="AsyncQueryableEx.Generated.tt" />
     <Compile Update="System\Linq\AsyncQueryableEx.Generated.cs" DesignTime="True" AutoGen="True" DependentUpon="AsyncQueryableEx.Generated.tt" />
   </ItemGroup>
   </ItemGroup>
 
 
-  <ItemGroup>
-    <Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
-  </ItemGroup>
-
 </Project>
 </Project>

文件差异内容过多而无法显示
+ 201 - 201
Ix.NET/Source/System.Interactive.Async.Providers/System/Linq/AsyncQueryableEx.Generated.cs


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

@@ -113,16 +113,16 @@ namespace Tests
             enumerable?.Dispose();
             enumerable?.Dispose();
         }
         }
 
 
-        private class DisposeCounter : IAsyncEnumerable<object>
+        private class DisposeCounter : IAsyncEnumerable<object?>
         {
         {
             public int DisposeCount { get; private set; }
             public int DisposeCount { get; private set; }
 
 
-            public IAsyncEnumerator<object> GetAsyncEnumerator(CancellationToken cancellationToken)
+            public IAsyncEnumerator<object?> GetAsyncEnumerator(CancellationToken cancellationToken)
             {
             {
                 return new Enumerator(this);
                 return new Enumerator(this);
             }
             }
 
 
-            private class Enumerator : IAsyncEnumerator<object>
+            private class Enumerator : IAsyncEnumerator<object?>
             {
             {
                 private readonly DisposeCounter _disposeCounter;
                 private readonly DisposeCounter _disposeCounter;
 
 
@@ -142,7 +142,7 @@ namespace Tests
                     return new ValueTask<bool>(Task.Factory.StartNew(() => false));
                     return new ValueTask<bool>(Task.Factory.StartNew(() => false));
                 }
                 }
 
 
-                public object Current { get; private set; }
+                public object? Current { get; private set; }
             }
             }
         }
         }
     }
     }

+ 4 - 10
Ix.NET/Source/System.Interactive.Async.Tests/System.Interactive.Async.Tests.csproj

@@ -2,10 +2,9 @@
 
 
   <PropertyGroup>
   <PropertyGroup>
     <TargetFrameworks>netcoreapp2.1;net461;netcoreapp3.0</TargetFrameworks>
     <TargetFrameworks>netcoreapp2.1;net461;netcoreapp3.0</TargetFrameworks>
-    <NoWarn>$(NoWarn);CS0618</NoWarn>
+    <NoWarn>$(NoWarn);CS0618;CS8603;CS8625</NoWarn>
   </PropertyGroup>
   </PropertyGroup>
 
 
-
   <ItemGroup>
   <ItemGroup>
     <Content Include="xunit.runner.json">
     <Content Include="xunit.runner.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -18,15 +17,10 @@
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
-      <PrivateAssets>all</PrivateAssets>
-      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
-    </PackageReference>
-    <PackageReference Include="FluentAssertions" Version="5.6.0" />
-
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
+    <PackageReference Include="FluentAssertions" Version="5.9.0" />
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="xunit" Version="2.4.1" />
-
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 1 - 2
Ix.NET/Source/System.Interactive.Async.Tests/System/Linq/Operators/Never.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // 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. 
 // See the LICENSE file in the project root for more information. 
 
 
-using System;
 using System.Linq;
 using System.Linq;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
@@ -25,7 +24,7 @@ namespace Tests
         [Fact]
         [Fact]
         public async Task CancelToken_UnblocksAsync()
         public async Task CancelToken_UnblocksAsync()
         {
         {
-            var cts = new CancellationTokenSource();
+            using var cts = new CancellationTokenSource();
 
 
             var en = AsyncEnumerableEx.Never<int>().GetAsyncEnumerator(cts.Token);
             var en = AsyncEnumerableEx.Never<int>().GetAsyncEnumerator(cts.Token);
 
 

+ 0 - 1
Ix.NET/Source/System.Interactive.Async/System.Interactive.Async.csproj

@@ -5,7 +5,6 @@
     <AssemblyTitle>Interactive Extensions - Async Library</AssemblyTitle>
     <AssemblyTitle>Interactive Extensions - Async Library</AssemblyTitle>
     <TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
     <TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
     <PackageTags>Ix;Interactive;Extensions;Enumerable;Asynchronous</PackageTags>
     <PackageTags>Ix;Interactive;Extensions;Enumerable;Asynchronous</PackageTags>
-    <NullableContextOptions>enable</NullableContextOptions>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 0 - 10
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Distinct.cs

@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 // See the LICENSE file in the project root for more information. 
 
 
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -103,9 +102,6 @@ namespace System.Linq
 
 
             public DistinctAsyncIterator(IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
             public DistinctAsyncIterator(IAsyncEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey>? comparer)
             {
             {
-                Debug.Assert(source != null);
-                Debug.Assert(keySelector != null);
-
                 _source = source;
                 _source = source;
                 _keySelector = keySelector;
                 _keySelector = keySelector;
                 _comparer = comparer;
                 _comparer = comparer;
@@ -251,9 +247,6 @@ namespace System.Linq
 
 
             public DistinctAsyncIteratorWithTask(IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey>? comparer)
             public DistinctAsyncIteratorWithTask(IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey>? comparer)
             {
             {
-                Debug.Assert(source != null);
-                Debug.Assert(keySelector != null);
-
                 _source = source;
                 _source = source;
                 _keySelector = keySelector;
                 _keySelector = keySelector;
                 _comparer = comparer;
                 _comparer = comparer;
@@ -400,9 +393,6 @@ namespace System.Linq
 
 
             public DistinctAsyncIteratorWithTaskAndCancellation(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey>? comparer)
             public DistinctAsyncIteratorWithTaskAndCancellation(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey>? comparer)
             {
             {
-                Debug.Assert(source != null);
-                Debug.Assert(keySelector != null);
-
                 _source = source;
                 _source = source;
                 _keySelector = keySelector;
                 _keySelector = keySelector;
                 _comparer = comparer;
                 _comparer = comparer;

+ 1 - 1
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Never.cs

@@ -49,7 +49,7 @@ namespace System.Linq
 
 
                     _once = true;
                     _once = true;
                     var task = new TaskCompletionSource<bool>();
                     var task = new TaskCompletionSource<bool>();
-                    _registration = _token.Register(state => ((TaskCompletionSource<bool>)state).SetCanceled(), task);
+                    _registration = _token.Register(state => ((TaskCompletionSource<bool>)state!).SetCanceled(), task);
                     return new ValueTask<bool>(task.Task);
                     return new ValueTask<bool>(task.Task);
                 }
                 }
             }
             }

+ 0 - 3
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/OnErrorResumeNext.cs

@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 // See the LICENSE file in the project root for more information. 
 
 
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
 namespace System.Linq
 namespace System.Linq
@@ -50,8 +49,6 @@ namespace System.Linq
 
 
             public OnErrorResumeNextAsyncIterator(IEnumerable<IAsyncEnumerable<TSource>> sources)
             public OnErrorResumeNextAsyncIterator(IEnumerable<IAsyncEnumerable<TSource>> sources)
             {
             {
-                Debug.Assert(sources != null);
-
                 _sources = sources;
                 _sources = sources;
             }
             }
 
 

+ 1 - 4
Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Timeout.cs

@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 // See the LICENSE file in the project root for more information. 
 
 
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -36,8 +35,6 @@ namespace System.Linq
 
 
             public TimeoutAsyncIterator(IAsyncEnumerable<TSource> source, TimeSpan timeout)
             public TimeoutAsyncIterator(IAsyncEnumerable<TSource> source, TimeSpan timeout)
             {
             {
-                Debug.Assert(source != null);
-
                 _source = source;
                 _source = source;
                 _timeout = timeout;
                 _timeout = timeout;
             }
             }
@@ -107,7 +104,7 @@ namespace System.Linq
                                 // REVIEW: Should exceptions reported by a timed out MoveNextAsync operation come out
                                 // REVIEW: Should exceptions reported by a timed out MoveNextAsync operation come out
                                 //         when attempting to call DisposeAsync?
                                 //         when attempting to call DisposeAsync?
 
 
-                                _loserTask = next.ContinueWith((_, state) => ((IAsyncDisposable)state).DisposeAsync().AsTask(), _enumerator);
+                                _loserTask = next.ContinueWith((_, state) => ((IAsyncDisposable)state!).DisposeAsync().AsTask(), _enumerator);
 
 
                                 _sourceCTS!.Cancel();
                                 _sourceCTS!.Cancel();
 
 

+ 1 - 1
Ix.NET/Source/System.Interactive.Providers/System/Linq/QueryableEx.cs

@@ -100,7 +100,7 @@ namespace System.Linq
                 return type.GetMethods(BindingFlags.Static | BindingFlags.Public).ToLookup(m => m.Name);
                 return type.GetMethods(BindingFlags.Static | BindingFlags.Public).ToLookup(m => m.Name);
             }
             }
 
 
-            private static bool ArgsMatch(MethodInfo method, IList<Expression> arguments, Type[] typeArgs)
+            private static bool ArgsMatch(MethodInfo method, IList<Expression> arguments, Type[]? typeArgs)
             {
             {
                 //
                 //
                 // Number of parameters should match. Notice we've sanitized IQueryProvider "this"
                 // Number of parameters should match. Notice we've sanitized IQueryProvider "this"

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

@@ -42,7 +42,7 @@ namespace Tests
             }
             }
             catch (AggregateException ex)
             catch (AggregateException ex)
             {
             {
-                var inner = ex.Flatten().InnerException;
+                _ = ex.Flatten().InnerException;
 
 
                 // TODO: proper assert; unfortunately there's not always a good call stack
                 // TODO: proper assert; unfortunately there's not always a good call stack
             }
             }

+ 0 - 88
Ix.NET/Source/System.Interactive.Tests/BufferTest.cs

@@ -1,88 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class BufferTest : Tests
-    {
-        [Fact]
-        public void Buffer_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Buffer<int>(null, 5));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Buffer<int>(null, 5, 3));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.Buffer<int>(new[] { 1 }, 0));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.Buffer<int>(new[] { 1 }, 5, 0));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.Buffer<int>(new[] { 1 }, 0, 3));
-        }
-
-        [Fact]
-        public void Buffer1()
-        {
-            var rng = Enumerable.Range(0, 10);
-
-            var res = rng.Buffer(3).ToList();
-            Assert.Equal(4, res.Count);
-
-            Assert.True(res[0].SequenceEqual(new[] { 0, 1, 2 }));
-            Assert.True(res[1].SequenceEqual(new[] { 3, 4, 5 }));
-            Assert.True(res[2].SequenceEqual(new[] { 6, 7, 8 }));
-            Assert.True(res[3].SequenceEqual(new[] { 9 }));
-        }
-
-        [Fact]
-        public void Buffer2()
-        {
-            var rng = Enumerable.Range(0, 10);
-
-            var res = rng.Buffer(5).ToList();
-            Assert.Equal(2, res.Count);
-
-            Assert.True(res[0].SequenceEqual(new[] { 0, 1, 2, 3, 4 }));
-            Assert.True(res[1].SequenceEqual(new[] { 5, 6, 7, 8, 9 }));
-        }
-
-        [Fact]
-        public void Buffer3()
-        {
-            var rng = Enumerable.Empty<int>();
-
-            var res = rng.Buffer(5).ToList();
-            Assert.Empty(res);
-        }
-
-        [Fact]
-        public void Buffer4()
-        {
-            var rng = Enumerable.Range(0, 10);
-
-            var res = rng.Buffer(3, 2).ToList();
-            Assert.Equal(5, res.Count);
-
-            Assert.True(res[0].SequenceEqual(new[] { 0, 1, 2 }));
-            Assert.True(res[1].SequenceEqual(new[] { 2, 3, 4 }));
-            Assert.True(res[2].SequenceEqual(new[] { 4, 5, 6 }));
-            Assert.True(res[3].SequenceEqual(new[] { 6, 7, 8 }));
-            Assert.True(res[4].SequenceEqual(new[] { 8, 9 }));
-        }
-
-        [Fact]
-        public void Buffer5()
-        {
-            var rng = Enumerable.Range(0, 10);
-
-            var res = rng.Buffer(3, 4).ToList();
-            Assert.Equal(3, res.Count);
-
-            Assert.True(res[0].SequenceEqual(new[] { 0, 1, 2 }));
-            Assert.True(res[1].SequenceEqual(new[] { 4, 5, 6 }));
-            Assert.True(res[2].SequenceEqual(new[] { 8, 9 }));
-        }
-    }
-}

+ 0 - 89
Ix.NET/Source/System.Interactive.Tests/CaseTest.cs

@@ -1,89 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class CaseTest : Tests
-    {
-        [Fact]
-        public void Case_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Case<int, int>(null, new Dictionary<int, IEnumerable<int>>()));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Case<int, int>(() => 1, null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Case<int, int>(null, new Dictionary<int, IEnumerable<int>>(), new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Case<int, int>(() => 1, null, new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Case<int, int>(() => 1, new Dictionary<int, IEnumerable<int>>(), null));
-        }
-
-        [Fact]
-        public void Case1()
-        {
-            var x = 1;
-            var d = 'd';
-            var res = EnumerableEx.Case<int, char>(() => x, new Dictionary<int, IEnumerable<char>>
-            {
-                { 0, new[] { 'a' } },
-                { 1, new[] { 'b' } },
-                { 2, new[] { 'c' } },
-                { 3, EnumerableEx.Defer(() => new[] { d }) },
-            });
-
-            Assert.Equal('b', res.Single());
-            Assert.Equal('b', res.Single());
-
-            x = 0;
-            Assert.Equal('a', res.Single());
-
-            x = 2;
-            Assert.Equal('c', res.Single());
-
-            x = 3;
-            Assert.Equal('d', res.Single());
-
-            d = 'e';
-            Assert.Equal('e', res.Single());
-
-            x = 4;
-            Assert.True(res.IsEmpty());
-        }
-
-        [Fact]
-        public void Case2()
-        {
-            var x = 1;
-            var d = 'd';
-            var res = EnumerableEx.Case<int, char>(() => x, new Dictionary<int, IEnumerable<char>>
-            {
-                { 0, new[] { 'a' } },
-                { 1, new[] { 'b' } },
-                { 2, new[] { 'c' } },
-                { 3, EnumerableEx.Defer(() => new[] { d }) },
-            }, new[] { 'z' });
-
-            Assert.Equal('b', res.Single());
-            Assert.Equal('b', res.Single());
-
-            x = 0;
-            Assert.Equal('a', res.Single());
-
-            x = 2;
-            Assert.Equal('c', res.Single());
-
-            x = 3;
-            Assert.Equal('d', res.Single());
-
-            d = 'e';
-            Assert.Equal('e', res.Single());
-
-            x = 4;
-            Assert.Equal('z', res.Single());
-        }
-    }
-}

+ 0 - 210
Ix.NET/Source/System.Interactive.Tests/CatchTest.cs

@@ -1,210 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class CatchTest : Tests
-    {
-        [Fact]
-        public void Catch_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Catch<int>(null, new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Catch<int>(new[] { 1 }, null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Catch<int>(default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Catch<int>(default(IEnumerable<IEnumerable<int>>)));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Catch<int, Exception>(null, ex => new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Catch<int, Exception>(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void Catch1()
-        {
-            var ex = new MyException();
-            var res = EnumerableEx.Throw<int>(ex).Catch<int, MyException>(e => { Assert.Same(ex, e); return new[] { 42 }; }).Single();
-            Assert.Equal(42, res);
-        }
-
-        [Fact]
-        public void Catch2()
-        {
-            var ex = new MyException();
-            var res = EnumerableEx.Throw<int>(ex).Catch<int, Exception>(e => { Assert.Same(ex, e); return new[] { 42 }; }).Single();
-            Assert.Equal(42, res);
-        }
-
-        [Fact]
-        public void Catch3()
-        {
-            var ex = new MyException();
-            AssertThrows<MyException>(() =>
-            {
-                EnumerableEx.Throw<int>(ex).Catch<int, InvalidOperationException>(e => { Assert.True(false); return new[] { 42 }; }).Single();
-            });
-        }
-
-        [Fact]
-        public void Catch4()
-        {
-            var xs = Enumerable.Range(0, 10);
-            var res = xs.Catch<int, MyException>(e => { Assert.True(false); return new[] { 42 }; });
-            Assert.True(xs.SequenceEqual(res));
-        }
-
-        [Fact]
-        public void Catch5()
-        {
-            var xss = new[] { Enumerable.Range(0, 5), Enumerable.Range(5, 5) };
-            var res = EnumerableEx.Catch(xss);
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 5)));
-        }
-
-        [Fact]
-        public void Catch6()
-        {
-            var xss = new[] { Enumerable.Range(0, 5), Enumerable.Range(5, 5) };
-            var res = xss.Catch();
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 5)));
-        }
-
-        [Fact]
-        public void Catch7()
-        {
-            var xss = new[] { Enumerable.Range(0, 5), Enumerable.Range(5, 5) };
-            var res = xss[0].Catch(xss[1]);
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 5)));
-        }
-
-        [Fact]
-        public void Catch8()
-        {
-            var xss = new[] { Enumerable.Range(0, 5).Concat(EnumerableEx.Throw<int>(new MyException())), Enumerable.Range(5, 5) };
-            var res = EnumerableEx.Catch(xss);
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 10)));
-        }
-
-        [Fact]
-        public void Catch9()
-        {
-            var xss = new[] { Enumerable.Range(0, 5).Concat(EnumerableEx.Throw<int>(new MyException())), Enumerable.Range(5, 5) };
-            var res = xss.Catch();
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 10)));
-        }
-
-        [Fact]
-        public void Catch10()
-        {
-            var xss = new[] { Enumerable.Range(0, 5).Concat(EnumerableEx.Throw<int>(new MyException())), Enumerable.Range(5, 5) };
-            var res = xss[0].Catch(xss[1]);
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 10)));
-        }
-
-        [Fact]
-        public void Catch11()
-        {
-            var e1 = new MyException();
-            var ex1 = EnumerableEx.Throw<int>(e1);
-
-            var e2 = new MyException();
-            var ex2 = EnumerableEx.Throw<int>(e2);
-
-            var e3 = new MyException();
-            var ex3 = EnumerableEx.Throw<int>(e3);
-
-            var xss = new[] { Enumerable.Range(0, 2).Concat(ex1), Enumerable.Range(2, 2).Concat(ex2), ex3 };
-            var res = xss.Catch();
-
-            var e = res.GetEnumerator();
-            HasNext(e, 0);
-            HasNext(e, 1);
-            HasNext(e, 2);
-            HasNext(e, 3);
-            AssertThrows<MyException>(() => e.MoveNext(), ex => ex == e3);
-        }
-
-        [Fact]
-        public void Catch4_Array()
-        {
-            var xs = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
-            var res = xs.Catch<int, MyException>(e => { Assert.False(true); return new[] { 42 }; });
-            Assert.True(xs.SequenceEqual(res));
-        }
-
-        [Fact]
-        public void Catch5_Array()
-        {
-            var xss = new[] { new[] { 0, 1, 2, 3, 4 }, new[] { 5, 6, 7, 8, 9 } };
-            var res = EnumerableEx.Catch(xss);
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 5)));
-        }
-
-        [Fact]
-        public void Catch6_Array()
-        {
-            var xss = new[] { new[] { 0, 1, 2, 3, 4 }, new[] { 5, 6, 7, 8, 9 } };
-            var res = xss.Catch();
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 5)));
-        }
-
-        [Fact]
-        public void Catch7_Array()
-        {
-            var xss = new[] { new[] { 0, 1, 2, 3, 4 }, new[] { 5, 6, 7, 8, 9 } };
-            var res = xss[0].Catch(xss[1]);
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 5)));
-        }
-
-        [Fact]
-        public void Catch8_Array()
-        {
-            var xss = new[] { new[] { 0, 1, 2, 3, 4 }.Concat(EnumerableEx.Throw<int>(new MyException())), new[] { 5, 6, 7, 8, 9 } };
-            var res = EnumerableEx.Catch(xss);
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 10)));
-        }
-
-        [Fact]
-        public void Catch9_Array()
-        {
-            var xss = new[] { new[] { 0, 1, 2, 3, 4 }.Concat(EnumerableEx.Throw<int>(new MyException())), new[] { 5, 6, 7, 8, 9 } };
-            var res = xss.Catch();
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 10)));
-        }
-
-        [Fact]
-        public void Catch10_Array()
-        {
-            var xss = new[] { new[] { 0, 1, 2, 3, 4 }.Concat(EnumerableEx.Throw<int>(new MyException())), new[] { 5, 6, 7, 8, 9 } };
-            var res = xss[0].Catch(xss[1]);
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 10)));
-        }
-
-        [Fact]
-        public void Catch11_Array()
-        {
-            var e1 = new MyException();
-            var ex1 = EnumerableEx.Throw<int>(e1);
-
-            var e2 = new MyException();
-            var ex2 = EnumerableEx.Throw<int>(e2);
-
-            var e3 = new MyException();
-            var ex3 = EnumerableEx.Throw<int>(e3);
-
-            var xss = new[] { new[] { 0, 1 }.Concat(ex1), new[] { 2, 3 }.Concat(ex2), ex3 };
-            var res = xss.Catch();
-
-            var e = res.GetEnumerator();
-            HasNext(e, 0);
-            HasNext(e, 1);
-            HasNext(e, 2);
-            HasNext(e, 3);
-            AssertThrows<MyException>(() => e.MoveNext(), ex => ex == e3);
-        }
-    }
-}

+ 0 - 63
Ix.NET/Source/System.Interactive.Tests/ConcatTest.cs

@@ -1,63 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class ConcatTest : Tests
-    {
-        [Fact]
-        public void Concat_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Concat(default(IEnumerable<int>[])));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Concat(default(IEnumerable<IEnumerable<int>>)));
-        }
-
-        [Fact]
-        public void Concat1()
-        {
-            var res = new[]
-            {
-                new[] { 1, 2, 3 },
-                new[] { 4, 5 }
-            }.Concat();
-
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 3, 4, 5 }));
-        }
-
-        [Fact]
-        public void Concat2()
-        {
-            var i = 0;
-            var xss = Enumerable.Range(0, 3).Select(x => Enumerable.Range(0, x + 1)).Do(_ => ++i);
-
-            var res = xss.Concat().Select(x => i + " - " + x).ToList();
-
-            Assert.True(Enumerable.SequenceEqual(res, new[] {
-                "1 - 0",
-                "2 - 0",
-                "2 - 1",
-                "3 - 0",
-                "3 - 1",
-                "3 - 2",
-            }));
-        }
-
-        [Fact]
-        public void Concat3()
-        {
-            var res = EnumerableEx.Concat(
-                new[] { 1, 2, 3 },
-                new[] { 4, 5 }
-            );
-
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 3, 4, 5 }));
-        }
-    }
-}

+ 0 - 119
Ix.NET/Source/System.Interactive.Tests/CreateTest.cs

@@ -1,119 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-using System.Collections;
-using System.Threading;
-
-namespace Tests
-{
-    public class CreateTest : Tests
-    {
-        [Fact]
-        public void Create_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Create<int>(default));
-        }
-
-        [Fact]
-        public void Create1()
-        {
-            var hot = false;
-            var res = EnumerableEx.Create<int>(() =>
-            {
-                hot = true;
-                return MyEnumerator();
-            });
-
-            Assert.False(hot);
-
-            var e = res.GetEnumerator();
-            Assert.True(hot);
-
-            HasNext(e, 1);
-            HasNext(e, 2);
-            NoNext(e);
-
-            hot = false;
-            var f = ((IEnumerable)res).GetEnumerator();
-            Assert.True(hot);
-        }
-
-        [Fact]
-        public void CreateYield()
-        {
-            SynchronizationContext.SetSynchronizationContext(null);
-
-            var xs = EnumerableEx.Create<int>(async yield =>
-            {
-                var i = 0;
-                while (i < 10)
-                {
-                    await yield.Return(i++);
-                }
-            });
-
-            var j = 0;
-            foreach (var elem in xs)
-            {
-                Assert.Equal(j, elem);
-                j++;
-            }
-
-            Assert.Equal(10, j);
-        }
-
-        [Fact]
-        public void CreateYieldBreak()
-        {
-            SynchronizationContext.SetSynchronizationContext(null);
-
-            var xs = EnumerableEx.Create<int>(async yield =>
-            {
-                var i = 0;
-                while (true)
-                {
-                    if (i == 10)
-                    {
-                        await yield.Break();
-                        return;
-                    }
-
-                    await yield.Return(i++);
-                }
-            });
-
-            var j = 0;
-            foreach (var elem in xs)
-            {
-                Assert.Equal(elem, j);
-                j++;
-            }
-
-            Assert.Equal(10, j);
-        }
-
-        [Fact]
-        public void YielderNoReset()
-        {
-            var xs = EnumerableEx.Create<int>(async yield =>
-            {
-                await yield.Break();
-            });
-
-            AssertThrows<NotSupportedException>(() => xs.GetEnumerator().Reset());
-        }
-
-
-        private static IEnumerator<int> MyEnumerator()
-        {
-            yield return 1;
-            yield return 2;
-        }
-    }
-}

+ 0 - 53
Ix.NET/Source/System.Interactive.Tests/DeferTest.cs

@@ -1,53 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class DeferTest : Tests
-    {
-        [Fact]
-        public void Defer_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Defer<int>(null));
-        }
-
-        [Fact]
-        public void Defer1()
-        {
-            var i = 0;
-            var n = 5;
-            var xs = EnumerableEx.Defer(() =>
-            {
-                i++;
-                return Enumerable.Range(0, n);
-            });
-
-            Assert.Equal(0, i);
-
-            Assert.True(Enumerable.SequenceEqual(xs, Enumerable.Range(0, n)));
-            Assert.Equal(1, i);
-
-            n = 3;
-            Assert.True(Enumerable.SequenceEqual(xs, Enumerable.Range(0, n)));
-            Assert.Equal(2, i);
-        }
-
-        [Fact]
-        public void Defer2()
-        {
-            var xs = EnumerableEx.Defer<int>(() =>
-            {
-                throw new MyException();
-            });
-
-            AssertThrows<MyException>(() => xs.GetEnumerator().MoveNext());
-        }
-    }
-}

+ 0 - 52
Ix.NET/Source/System.Interactive.Tests/DistinctTest.cs

@@ -1,52 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class DistinctTest : Tests
-    {
-        [Fact]
-        public void Distinct_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Distinct<int, int>(null, _ => _));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Distinct<int, int>(new[] { 1 }, null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Distinct<int, int>(null, _ => _, EqualityComparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Distinct<int, int>(new[] { 1 }, null, EqualityComparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Distinct<int, int>(new[] { 1 }, _ => _, null));
-        }
-
-        [Fact]
-        public void Distinct1()
-        {
-            var res = Enumerable.Range(0, 10).Distinct(x => x % 5).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, Enumerable.Range(0, 5)));
-        }
-
-        [Fact]
-        public void Distinct2()
-        {
-            var res = Enumerable.Range(0, 10).Distinct(x => x % 5, new MyEqualityComparer()).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 0, 1 }));
-        }
-
-        private class MyEqualityComparer : IEqualityComparer<int>
-        {
-            public bool Equals(int x, int y)
-            {
-                return x % 2 == y % 2;
-            }
-
-            public int GetHashCode(int obj)
-            {
-                return EqualityComparer<int>.Default.GetHashCode(obj % 2);
-            }
-        }
-    }
-}

+ 0 - 42
Ix.NET/Source/System.Interactive.Tests/DistinctUntilChangedTest.cs

@@ -1,42 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class DistinctUntilChangedTest : Tests
-    {
-        [Fact]
-        public void DistinctUntilChanged_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DistinctUntilChanged<int>(null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DistinctUntilChanged<int>(null, EqualityComparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DistinctUntilChanged<int>(new[] { 1 }, null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DistinctUntilChanged<int, int>(null, _ => _));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DistinctUntilChanged<int, int>(new[] { 1 }, null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DistinctUntilChanged<int, int>(null, _ => _, EqualityComparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DistinctUntilChanged<int, int>(new[] { 1 }, null, EqualityComparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DistinctUntilChanged<int, int>(new[] { 1 }, _ => _, null));
-        }
-
-        [Fact]
-        public void DistinctUntilChanged1()
-        {
-            var res = new[] { 1, 2, 2, 3, 3, 3, 2, 2, 1 }.DistinctUntilChanged().ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 3, 2, 1 }));
-        }
-
-        [Fact]
-        public void DistinctUntilChanged2()
-        {
-            var res = new[] { 1, 1, 2, 3, 4, 5, 5, 6, 7 }.DistinctUntilChanged(x => x / 2).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 4, 6 }));
-        }
-    }
-}

+ 0 - 103
Ix.NET/Source/System.Interactive.Tests/DoTest.cs

@@ -1,103 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class DoTest : Tests
-    {
-        [Fact]
-        public void Do_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(null, _ => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(null, _ => { }, () => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(null, _ => { }, _ => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(null, _ => { }, _ => { }, () => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(new[] { 1 }, default(Action<int>)));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(new[] { 1 }, default, () => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(new[] { 1 }, _ => { }, default(Action)));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(new[] { 1 }, default, _ => { }, () => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(new[] { 1 }, _ => { }, default, () => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(new[] { 1 }, _ => { }, _ => { }, default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(new[] { 1 }, default, _ => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(new[] { 1 }, _ => { }, default(Action<Exception>)));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(null, new MyObserver()));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Do<int>(new[] { 1 }, default(IObserver<int>)));
-        }
-
-        [Fact]
-        public void Do1()
-        {
-            var n = 0;
-            Enumerable.Range(0, 10).Do(x => n += x).ForEach(_ => { });
-            Assert.Equal(45, n);
-        }
-
-        [Fact]
-        public void Do2()
-        {
-            var n = 0;
-            Enumerable.Range(0, 10).Do(x => n += x, () => n *= 2).ForEach(_ => { });
-            Assert.Equal(90, n);
-        }
-
-        [Fact]
-        public void Do3()
-        {
-            var ex = new MyException();
-            var ok = false;
-            AssertThrows<MyException>(() =>
-                EnumerableEx.Throw<int>(ex).Do(x => { Assert.True(false); }, e => { Assert.Equal(ex, e); ok = true; }).ForEach(_ => { })
-            );
-            Assert.True(ok);
-        }
-
-        [Fact]
-        public void Do4()
-        {
-            var obs = new MyObserver();
-            Enumerable.Range(0, 10).Do(obs).ForEach(_ => { });
-
-            Assert.True(obs.Done);
-            Assert.Equal(45, obs.Sum);
-        }
-
-        private class MyObserver : IObserver<int>
-        {
-            public int Sum;
-            public bool Done;
-
-            public void OnCompleted()
-            {
-                Done = true;
-            }
-
-            public void OnError(Exception error)
-            {
-                throw new NotImplementedException();
-            }
-
-            public void OnNext(int value)
-            {
-                Sum += value;
-            }
-        }
-
-        [Fact]
-        public void Do5()
-        {
-            var sum = 0;
-            var done = false;
-            Enumerable.Range(0, 10).Do(x => sum += x, ex => { throw ex; }, () => done = true).ForEach(_ => { });
-
-            Assert.True(done);
-            Assert.Equal(45, sum);
-        }
-    }
-}

+ 0 - 38
Ix.NET/Source/System.Interactive.Tests/DoWhileTest.cs

@@ -1,38 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class DoWhileTest : Tests
-    {
-        [Fact]
-        public void DoWhile_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DoWhile<int>(new[] { 1 }, null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.DoWhile<int>(null, () => true));
-        }
-
-        [Fact]
-        public void DoWhile1()
-        {
-            var x = 5;
-            var res = EnumerableEx.DoWhile(EnumerableEx.Defer(() => new[] { x }).Do(_ => x--), () => x > 0).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 5, 4, 3, 2, 1 }));
-        }
-
-        [Fact]
-        public void DoWhile2()
-        {
-            var x = 0;
-            var res = EnumerableEx.DoWhile(EnumerableEx.Defer(() => new[] { x }).Do(_ => x--), () => x > 0).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 0 }));
-        }
-    }
-}

+ 0 - 43
Ix.NET/Source/System.Interactive.Tests/ExpandTest.cs

@@ -1,43 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class ExpandTest : Tests
-    {
-        [Fact]
-        public void Expand_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Expand<int>(null, _ => new[] { _ }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Expand<int>(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void Expand1()
-        {
-            var res = new[] { 0 }.Expand(x => new[] { x + 1 }).Take(10).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, Enumerable.Range(0, 10)));
-        }
-
-        [Fact]
-        public void Expand2()
-        {
-            var res = new[] { 3 }.Expand(x => Enumerable.Range(0, x)).ToList();
-            var exp = new[] {
-                3,
-                0, 1, 2,
-                0,
-                0, 1,
-                0
-            };
-            Assert.True(Enumerable.SequenceEqual(res, exp));
-        }
-    }
-}

+ 0 - 86
Ix.NET/Source/System.Interactive.Tests/FinallyTest.cs

@@ -1,86 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class FinallyTest : Tests
-    {
-        [Fact]
-        public void Finally_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Finally<int>(null, () => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Finally<int>(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void Finally1()
-        {
-            var done = false;
-
-            var xs = Enumerable.Range(0, 2).Finally(() => done = true);
-            Assert.False(done);
-
-            var e = xs.GetEnumerator();
-            Assert.False(done);
-
-            HasNext(e, 0);
-            Assert.False(done);
-
-            HasNext(e, 1);
-            Assert.False(done);
-
-            NoNext(e);
-            Assert.True(done);
-        }
-
-        [Fact]
-        public void Finally2()
-        {
-            var done = false;
-
-            var xs = Enumerable.Range(0, 2).Finally(() => done = true);
-            Assert.False(done);
-
-            var e = xs.GetEnumerator();
-            Assert.False(done);
-
-            HasNext(e, 0);
-            Assert.False(done);
-
-            e.Dispose();
-            Assert.True(done);
-        }
-
-        [Fact]
-        public void Finally3()
-        {
-            var done = false;
-
-            var ex = new MyException();
-            var xs = EnumerableEx.Throw<int>(ex).Finally(() => done = true);
-            Assert.False(done);
-
-            var e = xs.GetEnumerator();
-            Assert.False(done);
-
-            try
-            {
-                HasNext(e, 0);
-                Assert.True(false);
-            }
-            catch (MyException ex_)
-            {
-                Assert.Same(ex, ex_);
-            }
-
-            Assert.True(done);
-        }
-    }
-}

+ 0 - 40
Ix.NET/Source/System.Interactive.Tests/ForEachTest.cs

@@ -1,40 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class ForEachTest : Tests
-    {
-        [Fact]
-        public void ForEach_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.ForEach<int>(null, x => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.ForEach<int>(new[] { 1 }, default(Action<int>)));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.ForEach<int>(null, (x, i) => { }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.ForEach<int>(new[] { 1 }, default(Action<int, int>)));
-        }
-
-        [Fact]
-        public void ForEach1()
-        {
-            var n = 0;
-            Enumerable.Range(5, 3).ForEach(x => n += x);
-            Assert.Equal(5 + 6 + 7, n);
-        }
-
-        [Fact]
-        public void ForEach2()
-        {
-            var n = 0;
-            Enumerable.Range(5, 3).ForEach((x, i) => n += x * i);
-            Assert.Equal(5 * 0 + 6 * 1 + 7 * 2, n);
-        }
-    }
-}

+ 0 - 27
Ix.NET/Source/System.Interactive.Tests/ForTest.cs

@@ -1,27 +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. 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class ForTest : Tests
-    {
-        [Fact]
-        public void For_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.For<int, int>(null, x => new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.For<int, int>(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void For()
-        {
-            var res = EnumerableEx.For(new[] { 1, 2, 3 }, x => Enumerable.Range(0, x)).ToList();
-            Assert.True(res.SequenceEqual(new[] { 0, 0, 1, 0, 1, 2 }));
-        }
-    }
-}

+ 0 - 30
Ix.NET/Source/System.Interactive.Tests/GenerateTest.cs

@@ -1,30 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class GenerateTest : Tests
-    {
-        [Fact]
-        public void Generate_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Generate<int, int>(0, null, _ => _, _ => _));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Generate<int, int>(0, _ => true, null, _ => _));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Generate<int, int>(0, _ => true, _ => _, null));
-        }
-
-        [Fact]
-        public void Generate()
-        {
-            var res = EnumerableEx.Generate(0, x => x < 5, x => x + 1, x => x * x).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 0, 1, 4, 9, 16 }));
-        }
-    }
-}

+ 0 - 30
Ix.NET/Source/System.Interactive.Tests/HideTest.cs

@@ -1,30 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class HideTest : Tests
-    {
-        [Fact]
-        public void Hide_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Hide<int>(null));
-        }
-
-        [Fact]
-        public void Hide()
-        {
-            var xs = new List<int> { 1, 2, 3 };
-            var ys = xs.Hide();
-            Assert.False(ys is List<int>);
-            Assert.True(xs.SequenceEqual(ys));
-        }
-    }
-}

+ 0 - 49
Ix.NET/Source/System.Interactive.Tests/IfTest.cs

@@ -1,49 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class IfTest : Tests
-    {
-        [Fact]
-        public void If_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.If<int>(null, new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.If<int>(() => true, null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.If<int>(null, new[] { 1 }, new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.If<int>(() => true, null, new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.If<int>(() => true, new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void If1()
-        {
-            var x = 5;
-            var res = EnumerableEx.If(() => x > 0, new[] { +1 }, new[] { -1 });
-
-            Assert.Equal(+1, res.Single());
-
-            x = -x;
-            Assert.Equal(-1, res.Single());
-        }
-
-        [Fact]
-        public void If2()
-        {
-            var x = 5;
-            var res = EnumerableEx.If(() => x > 0, new[] { +1 });
-
-            Assert.Equal(+1, res.Single());
-
-            x = -x;
-            Assert.True(res.IsEmpty());
-        }
-    }
-}

+ 0 - 29
Ix.NET/Source/System.Interactive.Tests/IgnoreElementsTest.cs

@@ -1,29 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class IgnoreElementsTest : Tests
-    {
-        [Fact]
-        public void IgnoreElements_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.IgnoreElements<int>(null));
-        }
-
-        [Fact]
-        public void IgnoreElements()
-        {
-            var n = 0;
-            Enumerable.Range(0, 10).Do(_ => n++).IgnoreElements().Take(5).ForEach(_ => { });
-            Assert.Equal(10, n);
-        }
-    }
-}

+ 0 - 33
Ix.NET/Source/System.Interactive.Tests/IsEmptyTest.cs

@@ -1,33 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class IsEmptyTest : Tests
-    {
-        [Fact]
-        public void IsEmtpy_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.IsEmpty<int>(null));
-        }
-
-        [Fact]
-        public void IsEmpty_Empty()
-        {
-            Assert.True(Enumerable.Empty<int>().IsEmpty());
-        }
-
-        [Fact]
-        public void IsEmpty_NonEmpty()
-        {
-            Assert.False(new[] { 1 }.IsEmpty());
-        }
-    }
-}

+ 0 - 36
Ix.NET/Source/System.Interactive.Tests/MaxByTest.cs

@@ -1,36 +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. 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class MaxByTest : Tests
-    {
-        [Fact]
-        public void MaxBy_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MaxBy(null, (int x) => x));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MaxBy(new[] { 1 }, default(Func<int, int>)));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MaxBy(null, (int x) => x, Comparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MaxBy(new[] { 1 }, default, Comparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MaxBy(new[] { 1 }, (int x) => x, null));
-        }
-
-        [Fact]
-        public void MaxBy()
-        {
-            var res = new[] { 2, 5, 0, 7, 4, 3, 6, 2, 1 }.MaxBy(x => x % 3);
-            Assert.True(res.SequenceEqual(new[] { 2, 5, 2 }));
-        }
-
-        [Fact]
-        public void MaxBy_Empty()
-        {
-            AssertThrows<InvalidOperationException>(() => Enumerable.Empty<int>().MaxBy(x => x));
-        }
-    }
-}

+ 0 - 36
Ix.NET/Source/System.Interactive.Tests/MaxTest.cs

@@ -1,36 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class MaxTest : Tests
-    {
-        [Fact]
-        public void Max_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Max(null, Comparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Max(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void Max()
-        {
-            Assert.Equal(5, new[] { 2, 5, 3, 7 }.Max(new Mod7Comparer()));
-        }
-
-        private class Mod7Comparer : IComparer<int>
-        {
-            public int Compare(int x, int y)
-            {
-                return Comparer<int>.Default.Compare(x % 7, y % 7);
-            }
-        }
-    }
-}

+ 0 - 273
Ix.NET/Source/System.Interactive.Tests/MemoizeTest.cs

@@ -1,273 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-using System.Collections;
-
-namespace Tests
-{
-    public class MemoizeTest : Tests
-    {
-        [Fact]
-        public void Memoize_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Memoize<int>(null));
-        }
-
-        [Fact]
-        public void MemoizeLimited_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Memoize<int>(null, 2));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.Memoize<int>(new[] { 1 }, 0));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.Memoize<int>(new[] { 1 }, -1));
-        }
-
-        [Fact]
-        public void Memoize0()
-        {
-            var n = 0;
-            var rng = Tick(i => n += i).Memoize();
-
-            var e1 = rng.GetEnumerator();
-            var e2 = rng.GetEnumerator();
-
-            HasNext(e1, 0);
-            Assert.Equal(0, n);
-
-            HasNext(e1, 1);
-            Assert.Equal(1, n);
-
-            HasNext(e1, 2);
-            Assert.Equal(3, n);
-            HasNext(e2, 0);
-            Assert.Equal(3, n);
-
-            HasNext(e1, 3);
-            Assert.Equal(6, n);
-            HasNext(e2, 1);
-            Assert.Equal(6, n);
-
-            HasNext(e2, 2);
-            Assert.Equal(6, n);
-            HasNext(e2, 3);
-            Assert.Equal(6, n);
-
-            HasNext(e2, 4);
-            Assert.Equal(10, n);
-            HasNext(e1, 4);
-            Assert.Equal(10, n);
-        }
-
-        [Fact]
-        public void Memoize1()
-        {
-            var rng = Enumerable.Range(0, 5).Memoize();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-            HasNext(e1, 3);
-            HasNext(e1, 4);
-            NoNext(e1);
-        }
-
-        [Fact]
-        public void Memoize2()
-        {
-            var rng = Enumerable.Range(0, 5).Memoize();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-            HasNext(e1, 3);
-            HasNext(e1, 4);
-            NoNext(e1);
-
-            var e2 = rng.GetEnumerator();
-            HasNext(e2, 0);
-            HasNext(e2, 1);
-            HasNext(e2, 2);
-            HasNext(e2, 3);
-            HasNext(e2, 4);
-            NoNext(e2);
-        }
-
-        [Fact]
-        public void Memoize3()
-        {
-            var rng = Enumerable.Range(0, 5).Memoize();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-
-            var e2 = rng.GetEnumerator();
-            HasNext(e1, 3);
-            HasNext(e2, 0);
-            HasNext(e2, 1);
-            HasNext(e1, 4);
-            HasNext(e2, 2);
-            NoNext(e1);
-
-            HasNext(e2, 3);
-            HasNext(e2, 4);
-            NoNext(e2);
-        }
-
-        [Fact]
-        public void Memoize4()
-        {
-            var rng = Enumerable.Range(0, 5).Memoize(2);
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-
-            var e2 = rng.GetEnumerator();
-            HasNext(e2, 0);
-            HasNext(e2, 1);
-            HasNext(e2, 2);
-
-            var e3 = rng.GetEnumerator();
-            AssertThrows<InvalidOperationException>(() => e3.MoveNext());
-        }
-
-        [Fact]
-        public void Memoize6()
-        {
-            var ex = new MyException();
-            var rng = Enumerable.Range(0, 2).Concat(EnumerableEx.Throw<int>(ex)).Memoize();
-
-            var e1 = rng.GetEnumerator();
-            var e2 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            AssertThrows<MyException>(() => e1.MoveNext());
-
-            HasNext(e2, 0);
-            HasNext(e2, 1);
-            AssertThrows<MyException>(() => e2.MoveNext());
-        }
-
-        [Fact]
-        public void Memoize7()
-        {
-            var rng = Enumerable.Range(0, 5).Memoize();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-            e1.Dispose();
-
-            var e2 = rng.GetEnumerator();
-            HasNext(e2, 0);
-            HasNext(e2, 1);
-            e2.Dispose();
-
-            var e3 = rng.GetEnumerator();
-            HasNext(e3, 0);
-            HasNext(e3, 1);
-            HasNext(e3, 2);
-            HasNext(e3, 3);
-            HasNext(e3, 4);
-            NoNext(e3);
-        }
-
-        [Fact]
-        public void Memoize8()
-        {
-            var rng = Enumerable.Range(0, 5).Memoize();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-
-            rng.Dispose();
-            AssertThrows<ObjectDisposedException>(() => e1.MoveNext());
-            AssertThrows<ObjectDisposedException>(() => rng.GetEnumerator());
-            AssertThrows<ObjectDisposedException>(() => ((IEnumerable)rng).GetEnumerator());
-        }
-
-        [Fact]
-        public void Memoize9()
-        {
-            var rng = Enumerable.Range(0, 5).Memoize();
-
-            var e1 = ((IEnumerable)rng).GetEnumerator();
-            Assert.True(e1.MoveNext());
-            Assert.Equal(0, (int)e1.Current);
-        }
-
-        [Fact]
-        public void Memoize10()
-        {
-            var rnd = Rand().Take(1000).Memoize();
-            Assert.True(rnd.Zip(rnd, (l, r) => l == r).All(x => x));
-        }
-
-        [Fact]
-        public void MemoizeLambda_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Memoize<int, int>(null, xs => xs));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Memoize<int, int>(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void MemoizeLambda()
-        {
-            var n = 0;
-            var res = Enumerable.Range(0, 10).Do(_ => n++).Memoize(xs => xs.Zip(xs, (l, r) => l + r).Take(4)).ToList();
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 4).Select(x => x * 2)));
-            Assert.Equal(4, n);
-        }
-
-        [Fact]
-        public void MemoizeLimitedLambda_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Memoize<int, int>(null, 2, xs => xs));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Memoize<int, int>(new[] { 1 }, 2, null));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.Memoize<int, int>(new[] { 1 }, 0, xs => xs));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.Memoize<int, int>(new[] { 1 }, -1, xs => xs));
-        }
-
-        [Fact]
-        public void MemoizeLimitedLambda()
-        {
-            var n = 0;
-            var res = Enumerable.Range(0, 10).Do(_ => n++).Memoize(2, xs => xs.Zip(xs, (l, r) => l + r).Take(4)).ToList();
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 4).Select(x => x * 2)));
-            Assert.Equal(4, n);
-        }
-
-        private static readonly Random Random = new Random();
-
-        private static IEnumerable<int> Rand()
-        {
-            while (true)
-            {
-                yield return Random.Next();
-            }
-        }
-
-        private static IEnumerable<int> Tick(Action<int> t)
-        {
-            var i = 0;
-            while (true)
-            {
-                t(i);
-                yield return i++;
-            }
-        }
-    }
-}

+ 0 - 38
Ix.NET/Source/System.Interactive.Tests/MinByTest.cs

@@ -1,38 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class MinByTest : Tests
-    {
-        [Fact]
-        public void MinBy_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MinBy(null, (int x) => x));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MinBy(new[] { 1 }, default(Func<int, int>)));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MinBy(null, (int x) => x, Comparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MinBy(new[] { 1 }, default, Comparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.MinBy(new[] { 1 }, (int x) => x, null));
-        }
-
-        [Fact]
-        public void MinBy()
-        {
-            var res = new[] { 2, 5, 0, 7, 4, 3, 6, 2, 1 }.MinBy(x => x % 3);
-            Assert.True(res.SequenceEqual(new[] { 0, 3, 6 }));
-        }
-
-        [Fact]
-        public void MinBy_Empty()
-        {
-            AssertThrows<InvalidOperationException>(() => Enumerable.Empty<int>().MinBy(x => x));
-        }
-    }
-}

+ 0 - 36
Ix.NET/Source/System.Interactive.Tests/MinTest.cs

@@ -1,36 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class MinTest : Tests
-    {
-        [Fact]
-        public void Min_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Min(null, Comparer<int>.Default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Min(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void Min()
-        {
-            Assert.Equal(3, new[] { 5, 3, 7 }.Min(new Mod3Comparer()));
-        }
-
-        private class Mod3Comparer : IComparer<int>
-        {
-            public int Compare(int x, int y)
-            {
-                return Comparer<int>.Default.Compare(x % 3, y % 3);
-            }
-        }
-    }
-}

+ 0 - 23
Ix.NET/Source/System.Interactive.Tests/NopObserver.cs

@@ -1,23 +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. 
-
-using System;
-
-namespace Tests
-{
-    public class NopObserver<T> : IObserver<T>
-    {
-        public void OnCompleted()
-        {
-        }
-
-        public void OnError(Exception error)
-        {
-        }
-
-        public void OnNext(T value)
-        {
-        }
-    }
-}

+ 0 - 86
Ix.NET/Source/System.Interactive.Tests/OnErrorResumeNextTest.cs

@@ -1,86 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class OnErrorResumeNextTest : Tests
-    {
-        [Fact]
-        public void OnErrorResumeNext_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.OnErrorResumeNext<int>(null, new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.OnErrorResumeNext<int>(new[] { 1 }, null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.OnErrorResumeNext<int>(default));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.OnErrorResumeNext<int>(default(IEnumerable<IEnumerable<int>>)));
-        }
-
-        [Fact]
-        public void OnErrorResumeNext1()
-        {
-            var xs = new[] { 1, 2 };
-            var ys = new[] { 3, 4 };
-
-            var res = xs.OnErrorResumeNext(ys);
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 3, 4 }));
-        }
-
-        [Fact]
-        public void OnErrorResumeNext2()
-        {
-            var xs = new[] { 1, 2 }.Concat(EnumerableEx.Throw<int>(new MyException()));
-            var ys = new[] { 3, 4 };
-
-            var res = xs.OnErrorResumeNext(ys);
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 3, 4 }));
-        }
-
-        [Fact]
-        public void OnErrorResumeNext3()
-        {
-            var xs = new[] { 1, 2 };
-            var ys = new[] { 3, 4 };
-            var zs = new[] { 5, 6 };
-
-            var res = EnumerableEx.OnErrorResumeNext(xs, ys, zs);
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 3, 4, 5, 6 }));
-        }
-
-        [Fact]
-        public void OnErrorResumeNext4()
-        {
-            var xs = new[] { 1, 2 }.Concat(EnumerableEx.Throw<int>(new MyException()));
-            var ys = new[] { 3, 4 };
-            var zs = new[] { 5, 6 };
-
-            var res = EnumerableEx.OnErrorResumeNext(xs, ys, zs);
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 3, 4, 5, 6 }));
-        }
-
-        [Fact]
-        public void OnErrorResumeNext5()
-        {
-            var xs = new[] { 1, 2 };
-            var ys = new[] { 3, 4 };
-
-            var res = new[] { xs, ys }.OnErrorResumeNext();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 3, 4 }));
-        }
-
-        [Fact]
-        public void OnErrorResumeNext6()
-        {
-            var xs = new[] { 1, 2 }.Concat(EnumerableEx.Throw<int>(new MyException()));
-            var ys = new[] { 3, 4 };
-
-            var res = new[] { xs, ys }.OnErrorResumeNext();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 2, 3, 4 }));
-        }
-    }
-}

+ 0 - 284
Ix.NET/Source/System.Interactive.Tests/PublishTest.cs

@@ -1,284 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-using System.Collections;
-
-namespace Tests
-{
-    public class PublishTest : Tests
-    {
-        [Fact]
-        public void Publish_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Publish<int>(null));
-        }
-
-        [Fact]
-        public void Publish0()
-        {
-            var n = 0;
-            var rng = Tick(i => n += i).Publish();
-
-            var e1 = rng.GetEnumerator();
-            var e2 = rng.GetEnumerator();
-
-            HasNext(e1, 0);
-            Assert.Equal(0, n);
-
-            HasNext(e1, 1);
-            Assert.Equal(1, n);
-
-            HasNext(e1, 2);
-            Assert.Equal(3, n);
-            HasNext(e2, 0);
-            Assert.Equal(3, n);
-
-            HasNext(e1, 3);
-            Assert.Equal(6, n);
-            HasNext(e2, 1);
-            Assert.Equal(6, n);
-
-            HasNext(e2, 2);
-            Assert.Equal(6, n);
-            HasNext(e2, 3);
-            Assert.Equal(6, n);
-
-            HasNext(e2, 4);
-            Assert.Equal(10, n);
-            HasNext(e1, 4);
-            Assert.Equal(10, n);
-        }
-
-        [Fact]
-        public void Publish1()
-        {
-            var rng = Enumerable.Range(0, 5).Publish();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-            HasNext(e1, 3);
-            HasNext(e1, 4);
-            NoNext(e1);
-        }
-
-        [Fact]
-        public void Publish2()
-        {
-            var rng = Enumerable.Range(0, 5).Publish();
-
-            var e1 = rng.GetEnumerator();
-            var e2 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e2, 0);
-            HasNext(e1, 1);
-            HasNext(e2, 1);
-            HasNext(e1, 2);
-            HasNext(e2, 2);
-            HasNext(e1, 3);
-            HasNext(e2, 3);
-            HasNext(e1, 4);
-            HasNext(e2, 4);
-            NoNext(e1);
-            NoNext(e2);
-        }
-
-        [Fact]
-        public void Publish3()
-        {
-            var rng = Enumerable.Range(0, 5).Publish();
-
-            var e1 = rng.GetEnumerator();
-            var e2 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-            HasNext(e1, 3);
-            HasNext(e1, 4);
-            HasNext(e2, 0);
-            HasNext(e2, 1);
-            HasNext(e2, 2);
-            HasNext(e2, 3);
-            HasNext(e2, 4);
-            NoNext(e1);
-            NoNext(e2);
-        }
-
-        [Fact]
-        public void Publish4()
-        {
-            var rng = Enumerable.Range(0, 5).Publish();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-            var e2 = rng.GetEnumerator();
-            HasNext(e1, 3);
-            HasNext(e1, 4);
-            HasNext(e2, 3);
-            HasNext(e2, 4);
-            NoNext(e1);
-            NoNext(e2);
-        }
-
-        [Fact]
-        public void Publish5()
-        {
-            var rng = Enumerable.Range(0, 5).Publish();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-            e1.Dispose();
-
-            var e2 = rng.GetEnumerator();
-            HasNext(e2, 3);
-            HasNext(e2, 4);
-            NoNext(e2);
-        }
-
-        [Fact]
-        public void Publish6()
-        {
-            var ex = new MyException();
-            var rng = Enumerable.Range(0, 2).Concat(EnumerableEx.Throw<int>(ex)).Publish();
-
-            var e1 = rng.GetEnumerator();
-            var e2 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            AssertThrows<MyException>(() => e1.MoveNext());
-
-            HasNext(e2, 0);
-            HasNext(e2, 1);
-            AssertThrows<MyException>(() => e2.MoveNext());
-        }
-
-        [Fact]
-        public void Publish7()
-        {
-            var rng = Enumerable.Range(0, 5).Publish();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-
-            var e2 = rng.GetEnumerator();
-            HasNext(e2, 3);
-            HasNext(e2, 4);
-            NoNext(e2);
-
-            HasNext(e1, 3);
-            HasNext(e1, 4);
-            NoNext(e2);
-
-            var e3 = rng.GetEnumerator();
-            NoNext(e3);
-        }
-
-        [Fact]
-        public void Publish8()
-        {
-            var rng = Enumerable.Range(0, 5).Publish();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-
-            rng.Dispose();
-            AssertThrows<ObjectDisposedException>(() => e1.MoveNext());
-            AssertThrows<ObjectDisposedException>(() => rng.GetEnumerator());
-            AssertThrows<ObjectDisposedException>(() => ((IEnumerable)rng).GetEnumerator());
-        }
-
-        [Fact]
-        public void Publish9()
-        {
-            var rng = Enumerable.Range(0, 5).Publish();
-
-            var e1 = ((IEnumerable)rng).GetEnumerator();
-            Assert.True(e1.MoveNext());
-            Assert.Equal(0, (int)e1.Current);
-        }
-
-        [Fact]
-        public void Publish10()
-        {
-            var rnd = Rand().Take(1000).Publish();
-            Assert.True(rnd.Zip(rnd, (l, r) => l == r).All(x => x));
-        }
-
-        [Fact]
-        public void Publish11()
-        {
-            var rng = Enumerable.Range(0, 5).Publish();
-
-            var e1 = rng.GetEnumerator();
-            var e2 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-            e1.Dispose();
-
-            HasNext(e2, 0);
-            HasNext(e2, 1);
-            e2.Dispose();
-
-            var e3 = rng.GetEnumerator();
-            HasNext(e3, 3);
-            HasNext(e3, 4);
-            NoNext(e3);
-        }
-
-        [Fact]
-        public void PublishLambda_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Publish<int, int>(null, xs => xs));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Publish<int, int>(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void PublishLambda()
-        {
-            var n = 0;
-            var res = Enumerable.Range(0, 10).Do(_ => n++).Publish(xs => xs.Zip(xs, (l, r) => l + r).Take(4)).ToList();
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 4).Select(x => x * 2)));
-            Assert.Equal(4, n);
-        }
-
-        private static readonly Random Random = new Random();
-
-        private static IEnumerable<int> Rand()
-        {
-            while (true)
-            {
-                yield return Random.Next();
-            }
-        }
-
-        private static IEnumerable<int> Tick(Action<int> t)
-        {
-            var i = 0;
-            while (true)
-            {
-                t(i);
-                yield return i++;
-            }
-        }
-    }
-
-    internal class MyException : Exception
-    {
-    }
-}

+ 0 - 163
Ix.NET/Source/System.Interactive.Tests/QueryableParityTest.cs

@@ -1,163 +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. 
-
-using System;
-using System.ComponentModel;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using Xunit;
-
-namespace Tests
-{
-    public class QueryableParity : Tests
-    {
-        [Fact]
-        public void Queryable_Enumerable_Parity()
-        {
-            var enu = typeof(EnumerableEx).GetRuntimeMethods().Where(m => m.IsStatic && m.IsPublic).ToList();
-            var qry = typeof(QueryableEx).GetRuntimeMethods().Where(m => m.IsStatic && m.IsPublic).ToList();
-
-            var onlyInObs = enu.Select(m => m.Name).Except(qry.Select(m => m.Name)).Except(new[] { "ForEach", "ToEnumerable", "Multicast", "GetAwaiter", "ToEvent", "ToEventPattern", "ForEachAsync" }).ToList();
-            var onlyInQbs = qry.Select(m => m.Name).Except(enu.Select(m => m.Name)).Except(new[] { "ToQueryable", "get_Provider", "Empty", "Range" }).ToList();
-
-            Assert.True(onlyInObs.Count == 0, "Missing Queryable operator: " + string.Join(", ", onlyInObs.ToArray()));
-            Assert.True(onlyInQbs.Count == 0, "Missing Enumerable operator: " + string.Join(", ", onlyInQbs.ToArray()));
-
-            var enus = enu.GroupBy(m => m.Name);
-            var qrys = qry.GroupBy(m => m.Name);
-            var mtch = (from o in enus
-                        join q in qrys on o.Key equals q.Key
-                        select new { Name = o.Key, Enumerable = o.ToList(), Queryable = q.ToList() })
-                       .ToList();
-
-            bool filterReturn(Type t)
-            {
-                if (t.GetTypeInfo().IsGenericType)
-                {
-                    var gd = t.GetGenericTypeDefinition();
-                    if (gd == typeof(IBuffer<>))
-                    {
-                        return false;
-                    }
-                }
-                return true;
-            }
-
-            bool filterHelper(MethodInfo m)
-            {
-                return !m.IsDefined(typeof(EditorBrowsableAttribute), false);
-            }
-
-            foreach (var group in mtch)
-            {
-                var oss = group.Enumerable
-                    .Where(m => filterReturn(m.ReturnType))
-                    .Select(m => GetSignature(m, false))
-                    .OrderBy(x => x).ToList();
-
-                var qss = group.Queryable
-                    .Where(m => filterHelper(m))
-                    .Select(m => GetSignature(m, true))
-                    .OrderBy(x => x).ToList();
-
-                if (!group.Name.Equals("Create"))
-                {
-                    Assert.True(oss.SequenceEqual(qss), "Mismatch between QueryableEx and EnumerableEx for " + group.Name);
-                }
-            }
-        }
-
-        public static string GetSignature(MethodInfo m, bool correct)
-        {
-            var ps = m.GetParameters();
-            var pss = ps.AsEnumerable();
-            if (correct && ps.Length > 0 && ps[0].ParameterType == typeof(IQueryProvider))
-            {
-                pss = pss.Skip(1);
-            }
-
-            var gens = m.IsGenericMethod ? string.Format("<{0}>", string.Join(", ", m.GetGenericArguments().Select(a => GetTypeName(a, correct)).ToArray())) : "";
-
-            var pars = string.Join(", ", pss.Select(p => (p.IsDefined(typeof(ParamArrayAttribute)) ? "params " : "") + GetTypeName(p.ParameterType, correct) + " " + p.Name).ToArray());
-            if (m.IsDefined(typeof(ExtensionAttribute)))
-            {
-                if (pars.StartsWith("IQbservable") || pars.StartsWith("IQueryable"))
-                {
-                    pars = "this " + pars;
-                }
-            }
-
-            return string.Format("{0} {1}{2}({3})", GetTypeName(m.ReturnType, correct), m.Name, gens, pars);
-        }
-
-        public static string GetTypeName(Type t, bool correct)
-        {
-            if (t.GetTypeInfo().IsGenericType)
-            {
-                var gtd = t.GetGenericTypeDefinition();
-                if (gtd == typeof(Expression<>))
-                {
-                    return GetTypeName(t.GenericTypeArguments[0], false);
-                }
-
-                var args = string.Join(", ", t.GenericTypeArguments.Select(a => GetTypeName(a, false)).ToArray());
-
-                var len = t.Name.IndexOf('`');
-                var name = len >= 0 ? t.Name.Substring(0, len) : t.Name;
-                if (correct && name == "IQbservable")
-                {
-                    name = "IObservable";
-                }
-
-                if (correct && name == "IQueryable")
-                {
-                    name = "IEnumerable";
-                }
-
-                return string.Format("{0}<{1}>", name, args);
-            }
-
-            if (t.IsArray)
-            {
-                return GetTypeName(t.GetElementType(), correct) + "[]";
-            }
-
-            return t.Name;
-        }
-
-        [Fact]
-        public void QueryableRetarget1()
-        {
-            var res = QueryableEx.Provider.Empty<int>().AsEnumerable().ToList();
-            Assert.True(res.SequenceEqual(new int[0]));
-        }
-
-        [Fact]
-        public void QueryableRetarget2()
-        {
-            var res = QueryableEx.Provider.Return(42).AsEnumerable().ToList();
-            Assert.True(res.SequenceEqual(new[] { 42 }));
-        }
-
-        [Fact]
-        public void QueryableRetarget3()
-        {
-#if NETCOREAPP2_1 || WINDOWS_UWP
-            var res = QueryableEx.TakeLast(Enumerable.Range(0, 10).AsQueryable(), 2).AsEnumerable().ToList();
-#else
-            var res = Enumerable.Range(0, 10).AsQueryable().TakeLast(2).AsEnumerable().ToList();
-#endif
-            Assert.True(res.SequenceEqual(new[] { 8, 9 }));
-        }
-
-        [Fact]
-        public void QueryableRetarget4()
-        {
-            var res = QueryableEx.Provider.Range(0, 10).AsEnumerable().ToList();
-            Assert.True(res.SequenceEqual(Enumerable.Range(0, 10)));
-        }
-    }
-}

+ 0 - 55
Ix.NET/Source/System.Interactive.Tests/RepeatTest.cs

@@ -1,55 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class RepeatTest : Tests
-    {
-        [Fact]
-        public void RepeatElementInfinite()
-        {
-            var xs = EnumerableEx.Repeat(42).Take(1000);
-            Assert.True(xs.All(x => x == 42));
-            Assert.True(xs.Count() == 1000);
-        }
-
-        [Fact]
-        public void RepeatSequence_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Repeat<int>(null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Repeat<int>(null, 5));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.Repeat<int>(new[] { 1 }, -1));
-        }
-
-        [Fact]
-        public void RepeatSequence1()
-        {
-            var i = 0;
-            var xs = new[] { 1, 2 }.Do(_ => i++).Repeat();
-
-            var res = xs.Take(10).ToList();
-            Assert.Equal(10, res.Count);
-            Assert.True(res.Buffer(2).Select(b => b.Sum()).All(x => x == 3));
-            Assert.Equal(10, i);
-        }
-
-        [Fact]
-        public void RepeatSequence2()
-        {
-            var i = 0;
-            var xs = new[] { 1, 2 }.Do(_ => i++).Repeat(5);
-
-            var res = xs.ToList();
-            Assert.Equal(10, res.Count);
-            Assert.True(res.Buffer(2).Select(b => b.Sum()).All(x => x == 3));
-            Assert.Equal(10, i);
-        }
-    }
-}

+ 0 - 55
Ix.NET/Source/System.Interactive.Tests/RetryTest.cs

@@ -1,55 +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. 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class RetryTest : Tests
-    {
-
-        [Fact]
-        public void Retry_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Retry<int>(null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Retry<int>(null, 5));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.Retry<int>(new[] { 1 }, -1));
-        }
-
-        [Fact]
-        public void Retry1()
-        {
-            var xs = Enumerable.Range(0, 10);
-
-            var res = xs.Retry();
-            Assert.True(Enumerable.SequenceEqual(res, xs));
-        }
-
-        [Fact]
-        public void Retry2()
-        {
-            var xs = Enumerable.Range(0, 10);
-
-            var res = xs.Retry(2);
-            Assert.True(Enumerable.SequenceEqual(res, xs));
-        }
-
-        [Fact]
-        public void Retry3()
-        {
-            var ex = new MyException();
-            var xs = Enumerable.Range(0, 2).Concat(EnumerableEx.Throw<int>(ex));
-
-            var res = xs.Retry(2);
-            var e = res.GetEnumerator();
-            HasNext(e, 0);
-            HasNext(e, 1);
-            HasNext(e, 0);
-            HasNext(e, 1);
-            AssertThrows<MyException>(() => e.MoveNext(), ex_ => ex == ex_);
-        }
-    }
-}

+ 0 - 21
Ix.NET/Source/System.Interactive.Tests/ReturnTest.cs

@@ -1,21 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class ReturnTest : Tests
-    {
-        [Fact]
-        public void Return()
-        {
-            Assert.Equal(42, EnumerableEx.Return(42).Single());
-        }
-    }
-}

+ 0 - 36
Ix.NET/Source/System.Interactive.Tests/ScanTest.cs

@@ -1,36 +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. 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class ScanTest : Tests
-    {
-        [Fact]
-        public void Scan_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Scan<int>(null, (x, y) => x + y));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Scan<int>(new[] { 1 }, null));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Scan<int, int>(null, 0, (x, y) => x + y));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Scan<int, int>(new[] { 1 }, 0, null));
-        }
-
-        [Fact]
-        public void Scan1()
-        {
-            var res = Enumerable.Range(0, 5).Scan((n, x) => n + x).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 1, 3, 6, 10 }));
-        }
-
-        [Fact]
-        public void Scan2()
-        {
-            var res = Enumerable.Range(0, 5).Scan(10, (n, x) => n - x).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 10, 9, 7, 4, 0 }));
-        }
-    }
-}

+ 0 - 27
Ix.NET/Source/System.Interactive.Tests/SelectManyTest.cs

@@ -1,27 +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. 
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class SelectManyTest : Tests
-    {
-        [Fact]
-        public void SelectMany_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.SelectMany<int, int>(null, new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.SelectMany<int, int>(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void SelectMany()
-        {
-            var res = new[] { 1, 2 }.SelectMany(new[] { 'a', 'b', 'c' }).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 'a', 'b', 'c', 'a', 'b', 'c' }));
-        }
-    }
-}

+ 0 - 125
Ix.NET/Source/System.Interactive.Tests/ShareTest.cs

@@ -1,125 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-using System.Collections;
-
-namespace Tests
-{
-    public class ShareTest : Tests
-    {
-        [Fact]
-        public void Share_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Share<int>(null));
-        }
-
-        [Fact]
-        public void Share1()
-        {
-            var rng = Enumerable.Range(0, 5).Share();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-            HasNext(e1, 3);
-            HasNext(e1, 4);
-            NoNext(e1);
-        }
-
-        [Fact]
-        public void Share2()
-        {
-            var rng = Enumerable.Range(0, 5).Share();
-
-            var e1 = rng.GetEnumerator();
-            var e2 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e2, 1);
-            HasNext(e1, 2);
-            HasNext(e2, 3);
-            HasNext(e1, 4);
-            NoNext(e2);
-            NoNext(e1);
-        }
-
-        [Fact]
-        public void Share3()
-        {
-            var rng = Enumerable.Range(0, 5).Share();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-
-            var e2 = rng.GetEnumerator();
-            HasNext(e2, 3);
-            HasNext(e2, 4);
-            NoNext(e2);
-            NoNext(e1);
-        }
-
-        [Fact]
-        public void Share4()
-        {
-            var rng = Enumerable.Range(0, 5).Share();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-
-            e1.Dispose();
-            Assert.False(e1.MoveNext());
-        }
-
-        [Fact]
-        public void Share5()
-        {
-            var rng = Enumerable.Range(0, 5).Share();
-
-            var e1 = rng.GetEnumerator();
-            HasNext(e1, 0);
-            HasNext(e1, 1);
-            HasNext(e1, 2);
-
-            rng.Dispose();
-            AssertThrows<ObjectDisposedException>(() => e1.MoveNext());
-            AssertThrows<ObjectDisposedException>(() => rng.GetEnumerator());
-            AssertThrows<ObjectDisposedException>(() => ((IEnumerable)rng).GetEnumerator());
-        }
-
-        [Fact]
-        public void Share6()
-        {
-            var rng = Enumerable.Range(0, 5).Share();
-
-            var e1 = ((IEnumerable)rng).GetEnumerator();
-            Assert.True(e1.MoveNext());
-            Assert.Equal(0, (int)e1.Current);
-        }
-
-        [Fact]
-        public void ShareLambda_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Share<int, int>(null, xs => xs));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Share<int, int>(new[] { 1 }, null));
-        }
-
-        [Fact]
-        public void ShareLambda()
-        {
-            var n = 0;
-            var res = Enumerable.Range(0, 10).Do(_ => n++).Share(xs => xs.Zip(xs, (l, r) => l + r).Take(4)).ToList();
-            Assert.True(res.SequenceEqual(new[] { 0 + 1, 2 + 3, 4 + 5, 6 + 7 }));
-            Assert.Equal(8, n);
-        }
-    }
-}

+ 0 - 58
Ix.NET/Source/System.Interactive.Tests/SkipLastTest.cs

@@ -1,58 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class SkipLastTest : Tests
-    {
-        [Fact]
-        public void SkipLast_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.SkipLast<int>(null, 5));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.SkipLast<int>(new[] { 1 }, -1));
-        }
-
-        [Fact]
-        public void SkipLast_Empty()
-        {
-            var e = Enumerable.Empty<int>();
-#if NETCOREAPP2_1 || WINDOWS_UWP
-            var r = EnumerableEx.SkipLast(e, 1).ToList();
-#else
-            var r = e.SkipLast(1).ToList();
-#endif
-            Assert.True(Enumerable.SequenceEqual(r, e));
-        }
-
-        [Fact]
-        public void SkipLast_All()
-        {
-            var e = Enumerable.Range(0, 5);
-#if NETCOREAPP2_1 || WINDOWS_UWP
-            var r = EnumerableEx.SkipLast(e, 0).ToList();
-#else
-            var r = e.SkipLast(0).ToList();
-#endif
-            Assert.True(Enumerable.SequenceEqual(r, e));
-        }
-
-        [Fact]
-        public void SkipLast_Part()
-        {
-            var e = Enumerable.Range(0, 5);
-#if NETCOREAPP2_1 || WINDOWS_UWP
-            var r = EnumerableEx.SkipLast(e, 3).ToList();
-#else
-            var r = e.SkipLast(3).ToList();
-#endif
-            Assert.True(Enumerable.SequenceEqual(r, e.Take(2)));
-        }
-    }
-}

+ 0 - 38
Ix.NET/Source/System.Interactive.Tests/StartWithTest.cs

@@ -1,38 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class StartWithTest : Tests
-    {
-        [Fact]
-        public void StartWith_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.StartWith<int>(null, 5));
-        }
-
-        [Fact]
-        public void StartWith1()
-        {
-            var e = Enumerable.Range(1, 5);
-            var r = e.StartWith(0).ToList();
-            Assert.True(Enumerable.SequenceEqual(r, Enumerable.Range(0, 6)));
-        }
-
-        [Fact]
-        public void StartWith2()
-        {
-            var oops = false;
-            var e = Enumerable.Range(1, 5).Do(_ => oops = true);
-            var r = e.StartWith(0).Take(1).ToList();
-            Assert.False(oops);
-        }
-    }
-}

+ 3 - 5
Ix.NET/Source/System.Interactive.Tests/System.Interactive.Tests.csproj

@@ -2,10 +2,9 @@
 
 
   <PropertyGroup>
   <PropertyGroup>
     <TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
     <TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
-    <NoWarn>$(NoWarn);CS0618</NoWarn>
+    <NoWarn>$(NoWarn);CS0618;CS8603;CS8625</NoWarn>
   </PropertyGroup>
   </PropertyGroup>
 
 
-
   <ItemGroup>
   <ItemGroup>
     <Content Include="xunit.runner.json">
     <Content Include="xunit.runner.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -17,13 +16,12 @@
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
       <PrivateAssets>all</PrivateAssets>
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
     </PackageReference>
-    <PackageReference Include="FluentAssertions" Version="5.6.0" />
-    
+    <PackageReference Include="FluentAssertions" Version="5.9.0" />
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="xunit" Version="2.4.1" />
   </ItemGroup>
   </ItemGroup>
 
 

+ 1 - 1
Ix.NET/Source/System.Interactive.Tests/System/Linq/Operators/Publish.cs

@@ -162,7 +162,7 @@ namespace Tests
             AssertThrows<MyException>(() => e2.MoveNext());
             AssertThrows<MyException>(() => e2.MoveNext());
         }
         }
 
 
-        class MyException : Exception
+        private class MyException : Exception
         {
         {
         }
         }
 
 

+ 6 - 6
Ix.NET/Source/System.Interactive.Tests/System/Linq/Operators/Using.cs

@@ -26,12 +26,12 @@ namespace Tests
             Assert.Null(d);
             Assert.Null(d);
 
 
             var d1 = default(MyDisposable);
             var d1 = default(MyDisposable);
-            xs.ForEach(_ => { d1 = d; Assert.NotNull(d1); Assert.False(d1.Done); });
-            Assert.True(d1.Done);
+            xs.ForEach(_ => { d1 = d; Assert.NotNull(d1); Assert.False(d1!.Done); });
+            Assert.True(d1!.Done);
 
 
             var d2 = default(MyDisposable);
             var d2 = default(MyDisposable);
-            xs.ForEach(_ => { d2 = d; Assert.NotNull(d2); Assert.False(d2.Done); });
-            Assert.True(d2.Done);
+            xs.ForEach(_ => { d2 = d; Assert.NotNull(d2); Assert.False(d2!.Done); });
+            Assert.True(d2!.Done);
 
 
             Assert.NotSame(d1, d2);
             Assert.NotSame(d1, d2);
         }
         }
@@ -45,7 +45,7 @@ namespace Tests
             Assert.Null(d);
             Assert.Null(d);
 
 
             AssertThrows<MyException>(() => xs.ForEach(_ => { }));
             AssertThrows<MyException>(() => xs.ForEach(_ => { }));
-            Assert.True(d.Done);
+            Assert.True(d!.Done);
         }
         }
 
 
         [Fact]
         [Fact]
@@ -57,7 +57,7 @@ namespace Tests
             Assert.Null(d);
             Assert.Null(d);
 
 
             AssertThrows<MyException>(() => xs.ForEach(_ => { }));
             AssertThrows<MyException>(() => xs.ForEach(_ => { }));
-            Assert.True(d.Done);
+            Assert.True(d!.Done);
         }
         }
 
 
         private sealed class MyDisposable : IDisposable
         private sealed class MyDisposable : IDisposable

+ 0 - 73
Ix.NET/Source/System.Interactive.Tests/TakeLastTest.cs

@@ -1,73 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class TakeLastTest : Tests
-    {
-        [Fact]
-        public void TakeLast_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.TakeLast<int>(null, 5));
-            AssertThrows<ArgumentOutOfRangeException>(() => EnumerableEx.TakeLast<int>(new[] { 1 }, -1));
-        }
-
-        [Fact]
-        public void TakeLast_TakeZero()
-        {
-            var e = Enumerable.Range(1, 5);
-#if NETCOREAPP2_1 || WINDOWS_UWP
-            var r = EnumerableEx.TakeLast(e, 0).ToList();
-#else
-            var r = e.TakeLast(0).ToList();
-#endif
-            Assert.True(Enumerable.SequenceEqual(r, Enumerable.Empty<int>()));
-        }
-
-        [Fact]
-        public void TakeLast_Empty()
-        {
-            var e = Enumerable.Empty<int>();
-
-#if NETCOREAPP2_1 || WINDOWS_UWP
-            var r = EnumerableEx.TakeLast(e, 1).ToList();
-#else
-            var r = e.TakeLast(1).ToList();
-#endif
-            Assert.True(Enumerable.SequenceEqual(r, e));
-        }
-
-        [Fact]
-        public void TakeLast_All()
-        {
-            var e = Enumerable.Range(0, 5);
-
-#if NETCOREAPP2_1 || WINDOWS_UWP
-            var r = EnumerableEx.TakeLast(e, 5).ToList();
-#else
-            var r = e.TakeLast(5).ToList();
-#endif
-
-            Assert.True(Enumerable.SequenceEqual(r, e));
-        }
-
-        [Fact]
-        public void TakeLast_Part()
-        {
-            var e = Enumerable.Range(0, 5);
-#if NETCOREAPP2_1 || WINDOWS_UWP
-            var r = EnumerableEx.TakeLast(e, 3).ToList();
-#else
-            var r = e.TakeLast(3).ToList();
-#endif
-            Assert.True(Enumerable.SequenceEqual(r, e.Skip(2)));
-        }
-    }
-}

+ 0 - 31
Ix.NET/Source/System.Interactive.Tests/ThrowTest.cs

@@ -1,31 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class ThrowTest : Tests
-    {
-        [Fact]
-        public void Throw_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Throw<int>(null));
-        }
-
-        [Fact]
-        public void Throw()
-        {
-            var ex = new MyException();
-            var xs = EnumerableEx.Throw<int>(ex);
-
-            var e = xs.GetEnumerator();
-            AssertThrows<MyException>(() => e.MoveNext());
-        }
-    }
-}

+ 0 - 75
Ix.NET/Source/System.Interactive.Tests/UsingTest.cs

@@ -1,75 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class UsingTest : Tests
-    {
-        [Fact]
-        public void Using_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Using<int, MyDisposable>(null, d => new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.Using<int, MyDisposable>(() => new MyDisposable(), null));
-        }
-
-        [Fact]
-        public void Using1()
-        {
-            var d = default(MyDisposable);
-
-            var xs = EnumerableEx.Using(() => d = new MyDisposable(), d_ => new[] { 1 });
-            Assert.Null(d);
-
-            var d1 = default(MyDisposable);
-            xs.ForEach(_ => { d1 = d; Assert.NotNull(d1); Assert.False(d1.Done); });
-            Assert.True(d1.Done);
-
-            var d2 = default(MyDisposable);
-            xs.ForEach(_ => { d2 = d; Assert.NotNull(d2); Assert.False(d2.Done); });
-            Assert.True(d2.Done);
-
-            Assert.NotSame(d1, d2);
-        }
-
-        [Fact]
-        public void Using2()
-        {
-            var d = default(MyDisposable);
-
-            var xs = EnumerableEx.Using(() => d = new MyDisposable(), d_ => EnumerableEx.Throw<int>(new MyException()));
-            Assert.Null(d);
-
-            AssertThrows<MyException>(() => xs.ForEach(_ => { }));
-            Assert.True(d.Done);
-        }
-
-        [Fact]
-        public void Using3()
-        {
-            var d = default(MyDisposable);
-
-            var xs = EnumerableEx.Using<int, MyDisposable>(() => d = new MyDisposable(), d_ => { throw new MyException(); });
-            Assert.Null(d);
-
-            AssertThrows<MyException>(() => xs.ForEach(_ => { }));
-            Assert.True(d.Done);
-        }
-
-        private class MyDisposable : IDisposable
-        {
-            public bool Done;
-
-            public void Dispose()
-            {
-                Done = true;
-            }
-        }
-    }
-}

+ 0 - 38
Ix.NET/Source/System.Interactive.Tests/WhileTest.cs

@@ -1,38 +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. 
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using Xunit;
-
-namespace Tests
-{
-    public class WhileTest : Tests
-    {
-        [Fact]
-        public void While_Arguments()
-        {
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.While<int>(null, new[] { 1 }));
-            AssertThrows<ArgumentNullException>(() => EnumerableEx.While<int>(() => true, null));
-        }
-
-        [Fact]
-        public void While1()
-        {
-            var x = 5;
-            var res = EnumerableEx.While(() => x > 0, EnumerableEx.Defer(() => new[] { x }).Do(_ => x--)).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new[] { 5, 4, 3, 2, 1 }));
-        }
-
-        [Fact]
-        public void While2()
-        {
-            var x = 0;
-            var res = EnumerableEx.While(() => x > 0, EnumerableEx.Defer(() => new[] { x }).Do(_ => x--)).ToList();
-            Assert.True(Enumerable.SequenceEqual(res, new int[0]));
-        }
-    }
-}

+ 2 - 2
Ix.NET/Source/System.Interactive/System/Linq/Operators/Catch.cs

@@ -82,7 +82,7 @@ namespace System.Linq
             {
             {
                 while (true)
                 while (true)
                 {
                 {
-                    var c = default(TSource);
+                    TSource c;
 
 
                     try
                     try
                     {
                     {
@@ -121,7 +121,7 @@ namespace System.Linq
 
 
                 while (true)
                 while (true)
                 {
                 {
-                    var c = default(TSource);
+                    TSource c;
 
 
                     try
                     try
                     {
                     {

+ 1 - 1
Ix.NET/Source/System.Interactive/System/Linq/Operators/DistinctUntilChanged.cs

@@ -80,7 +80,7 @@ namespace System.Linq
 
 
         private static IEnumerable<TSource> DistinctUntilChangedCore<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
         private static IEnumerable<TSource> DistinctUntilChangedCore<TSource, TKey>(IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
         {
         {
-            var currentKey = default(TKey);
+            var currentKey = default(TKey)!;
             var hasCurrentKey = false;
             var hasCurrentKey = false;
 
 
             foreach (var item in source)
             foreach (var item in source)

+ 1 - 1
Ix.NET/Source/System.Interactive/System/Linq/Operators/IgnoreElements.cs

@@ -24,7 +24,7 @@ namespace System.Linq
 
 
         private static IEnumerable<TSource> IgnoreElementsCore<TSource>(IEnumerable<TSource> source)
         private static IEnumerable<TSource> IgnoreElementsCore<TSource>(IEnumerable<TSource> source)
         {
         {
-            foreach (var item in source)
+            foreach (var _ in source)
                 ;
                 ;
 
 
             yield break;
             yield break;

+ 8 - 9
Ix.NET/Source/System.Interactive/System/Linq/Operators/Memoize.cs

@@ -113,10 +113,12 @@ namespace System.Linq
 
 
         private sealed class MemoizedBuffer<T> : IBuffer<T>
         private sealed class MemoizedBuffer<T> : IBuffer<T>
         {
         {
-            private IRefCountList<T> _buffer;
+            private readonly object _gate = new object();
+            private readonly IRefCountList<T> _buffer;
+            private readonly IEnumerator<T> _source;
+
             private bool _disposed;
             private bool _disposed;
-            private Exception _error;
-            private IEnumerator<T> _source;
+            private Exception? _error;
             private bool _stopped;
             private bool _stopped;
 
 
             public MemoizedBuffer(IEnumerator<T> source)
             public MemoizedBuffer(IEnumerator<T> source)
@@ -153,15 +155,12 @@ namespace System.Linq
 
 
             public void Dispose()
             public void Dispose()
             {
             {
-                lock (_source)
+                lock (_gate)
                 {
                 {
                     if (!_disposed)
                     if (!_disposed)
                     {
                     {
                         _source.Dispose();
                         _source.Dispose();
-                        _source = null;
-
                         _buffer.Clear();
                         _buffer.Clear();
-                        _buffer = null;
                     }
                     }
 
 
                     _disposed = true;
                     _disposed = true;
@@ -180,9 +179,9 @@ namespace System.Linq
                             throw new ObjectDisposedException("");
                             throw new ObjectDisposedException("");
 
 
                         var hasValue = default(bool);
                         var hasValue = default(bool);
-                        var current = default(T);
+                        var current = default(T)!;
 
 
-                        lock (_source)
+                        lock (_gate)
                         {
                         {
                             if (i >= _buffer.Count)
                             if (i >= _buffer.Count)
                             {
                             {

+ 1 - 1
Ix.NET/Source/System.Interactive/System/Linq/Operators/OnErrorResumeNext.cs

@@ -63,7 +63,7 @@ namespace System.Linq
 
 
                 while (true)
                 while (true)
                 {
                 {
-                    var value = default(TSource);
+                    TSource value;
                     try
                     try
                     {
                     {
                         if (!innerEnumerator.MoveNext())
                         if (!innerEnumerator.MoveNext())

+ 9 - 10
Ix.NET/Source/System.Interactive/System/Linq/Operators/Publish.cs

@@ -61,10 +61,12 @@ namespace System.Linq
 
 
         private sealed class PublishedBuffer<T> : IBuffer<T>
         private sealed class PublishedBuffer<T> : IBuffer<T>
         {
         {
-            private RefCountList<T> _buffer;
+            private readonly object _gate = new object();
+            private readonly RefCountList<T> _buffer;
+            private readonly IEnumerator<T> _source;
+
             private bool _disposed;
             private bool _disposed;
-            private Exception _error;
-            private IEnumerator<T> _source;
+            private Exception? _error;
             private bool _stopped;
             private bool _stopped;
 
 
             public PublishedBuffer(IEnumerator<T> source)
             public PublishedBuffer(IEnumerator<T> source)
@@ -81,7 +83,7 @@ namespace System.Linq
                 }
                 }
 
 
                 var i = default(int);
                 var i = default(int);
-                lock (_source)
+                lock (_gate)
                 {
                 {
                     i = _buffer.Count;
                     i = _buffer.Count;
                     _buffer.ReaderCount++;
                     _buffer.ReaderCount++;
@@ -102,15 +104,12 @@ namespace System.Linq
 
 
             public void Dispose()
             public void Dispose()
             {
             {
-                lock (_source)
+                lock (_gate)
                 {
                 {
                     if (!_disposed)
                     if (!_disposed)
                     {
                     {
                         _source.Dispose();
                         _source.Dispose();
-                        _source = null;
-
                         _buffer.Clear();
                         _buffer.Clear();
-                        _buffer = null;
                     }
                     }
 
 
                     _disposed = true;
                     _disposed = true;
@@ -129,9 +128,9 @@ namespace System.Linq
                         }
                         }
 
 
                         var hasValue = default(bool);
                         var hasValue = default(bool);
-                        var current = default(T);
+                        var current = default(T)!;
 
 
-                        lock (_source)
+                        lock (_gate)
                         {
                         {
                             if (i >= _buffer.Count)
                             if (i >= _buffer.Count)
                             {
                             {

+ 1 - 1
Ix.NET/Source/System.Interactive/System/Linq/Operators/Scan.cs

@@ -65,7 +65,7 @@ namespace System.Linq
         private static IEnumerable<TSource> ScanCore<TSource>(IEnumerable<TSource> source, Func<TSource, TSource, TSource> accumulator)
         private static IEnumerable<TSource> ScanCore<TSource>(IEnumerable<TSource> source, Func<TSource, TSource, TSource> accumulator)
         {
         {
             var hasSeed = false;
             var hasSeed = false;
-            var acc = default(TSource);
+            var acc = default(TSource)!;
 
 
             foreach (var item in source)
             foreach (var item in source)
             {
             {

+ 8 - 5
Ix.NET/Source/System.Interactive/System/Linq/Operators/Share.cs

@@ -58,8 +58,8 @@ namespace System.Linq
 
 
         private class SharedBuffer<T> : IBuffer<T>
         private class SharedBuffer<T> : IBuffer<T>
         {
         {
+            private readonly IEnumerator<T> _source;
             private bool _disposed;
             private bool _disposed;
-            private IEnumerator<T> _source;
 
 
             public SharedBuffer(IEnumerator<T> source)
             public SharedBuffer(IEnumerator<T> source)
             {
             {
@@ -89,7 +89,6 @@ namespace System.Linq
                     if (!_disposed)
                     if (!_disposed)
                     {
                     {
                         _source.Dispose();
                         _source.Dispose();
-                        _source = null;
                     }
                     }
 
 
                     _disposed = true;
                     _disposed = true;
@@ -104,11 +103,15 @@ namespace System.Linq
 
 
                 private bool _disposed;
                 private bool _disposed;
 
 
-                public ShareEnumerator(SharedBuffer<T> parent) => _parent = parent;
+                public ShareEnumerator(SharedBuffer<T> parent)
+                {
+                    _parent = parent;
+                    Current = default!;
+                }
 
 
                 public T Current { get; private set; }
                 public T Current { get; private set; }
 
 
-                object IEnumerator.Current => Current;
+                object? IEnumerator.Current => Current;
 
 
                 public void Dispose() => _disposed = true;
                 public void Dispose() => _disposed = true;
 
 
@@ -138,7 +141,7 @@ namespace System.Linq
                         return true;
                         return true;
                     }
                     }
                     _disposed = true;
                     _disposed = true;
-                    Current = default;
+                    Current = default!;
                     return false;
                     return false;
                 }
                 }
 
 

+ 9 - 3
Ix.NET/Source/System.Interactive/System/Linq/RefCountList.cs

@@ -45,7 +45,7 @@ namespace System.Linq
 
 
         public void Add(T item)
         public void Add(T item)
         {
         {
-            _list[Count] = new RefCount { Value = item, Count = ReaderCount };
+            _list[Count] = new RefCount(item, ReaderCount);
 
 
             Count++;
             Count++;
         }
         }
@@ -62,8 +62,14 @@ namespace System.Linq
 
 
         private sealed class RefCount
         private sealed class RefCount
         {
         {
-            public int Count;
-            public T Value;
+            public RefCount(T value, int count)
+            {
+                Value = value;
+                Count = count;
+            }
+
+            public int Count { get; set; }
+            public T Value { get; }
         }
         }
     }
     }
 }
 }

+ 7 - 3
Ix.NET/Source/System.Interactive/System/Linq/Yielder.cs

@@ -9,12 +9,16 @@ namespace System.Linq
     internal sealed class Yielder<T> : IYielder<T>, IAwaitable, IAwaiter
     internal sealed class Yielder<T> : IYielder<T>, IAwaitable, IAwaiter
     {
     {
         private readonly Action<Yielder<T>> _create;
         private readonly Action<Yielder<T>> _create;
-        private Action _continuation;
+        private Action? _continuation;
         private bool _hasValue;
         private bool _hasValue;
         private bool _running;
         private bool _running;
         private bool _stopped;
         private bool _stopped;
 
 
-        public Yielder(Action<Yielder<T>> create) => _create = create;
+        public Yielder(Action<Yielder<T>> create)
+        {
+            _create = create;
+            Current = default!;
+        }
 
 
         public T Current { get; private set; }
         public T Current { get; private set; }
 
 
@@ -62,7 +66,7 @@ namespace System.Linq
             else
             else
             {
             {
                 _hasValue = false;
                 _hasValue = false;
-                _continuation();
+                _continuation!();
             }
             }
 
 
             return !_stopped && _hasValue;
             return !_stopped && _hasValue;

+ 1 - 1
Ix.NET/Source/System.Linq.Async.Queryable.Tests/AssertEx.cs

@@ -36,7 +36,7 @@ namespace Tests
             }
             }
             catch (AggregateException ex)
             catch (AggregateException ex)
             {
             {
-                var inner = ex.Flatten().InnerException;
+                _ = ex.Flatten().InnerException;
 
 
                 // TODO: proper assert; unfortunately there's not always a good call stack
                 // TODO: proper assert; unfortunately there's not always a good call stack
             }
             }

+ 3 - 8
Ix.NET/Source/System.Linq.Async.Queryable.Tests/System.Linq.Async.Queryable.Tests.csproj

@@ -5,7 +5,6 @@
     <NoWarn>$(NoWarn);CS0618</NoWarn>
     <NoWarn>$(NoWarn);CS0618</NoWarn>
   </PropertyGroup>
   </PropertyGroup>
 
 
-
   <ItemGroup>
   <ItemGroup>
     <Content Include="xunit.runner.json">
     <Content Include="xunit.runner.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -18,13 +17,9 @@
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
-      <PrivateAssets>all</PrivateAssets>
-      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
-    </PackageReference>
-    <PackageReference Include="FluentAssertions" Version="5.6.0" />
-
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
+    <PackageReference Include="FluentAssertions" Version="5.9.0" />
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="xunit" Version="2.4.1" />
   </ItemGroup>
   </ItemGroup>
 
 

+ 0 - 1
Ix.NET/Source/System.Linq.Async.Queryable/System.Linq.Async.Queryable.csproj

@@ -2,7 +2,6 @@
 
 
   <PropertyGroup>
   <PropertyGroup>
     <TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
     <TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
-    <NullableContextOptions>enable</NullableContextOptions>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 1 - 1
Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncEnumerableQuery.cs

@@ -133,7 +133,7 @@ namespace System.Linq
         /// Gets a string representation of the enumerable sequence.
         /// Gets a string representation of the enumerable sequence.
         /// </summary>
         /// </summary>
         /// <returns>String representation of the enumerable sequence.</returns>
         /// <returns>String representation of the enumerable sequence.</returns>
-        public override string ToString()
+        public override string? ToString()
         {
         {
             if (!(_expression is ConstantExpression ce) || ce.Value != this)
             if (!(_expression is ConstantExpression ce) || ce.Value != this)
             {
             {

+ 14 - 8
Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncEnumerableRewriter.cs

@@ -15,7 +15,7 @@ namespace System.Linq
     /// </summary>
     /// </summary>
     internal class AsyncEnumerableRewriter : ExpressionVisitor
     internal class AsyncEnumerableRewriter : ExpressionVisitor
     {
     {
-        private static volatile ILookup<string, MethodInfo> _methods;
+        private static volatile ILookup<string, MethodInfo>? _methods;
 
 
         protected override Expression VisitConstant(ConstantExpression node)
         protected override Expression VisitConstant(ConstantExpression node)
         {
         {
@@ -58,13 +58,14 @@ namespace System.Linq
                 return node;
                 return node;
             }
             }
 
 
+            var declType = node.Method.DeclaringType;
             var typeArgs = node.Method.IsGenericMethod ? node.Method.GetGenericArguments() : null;
             var typeArgs = node.Method.IsGenericMethod ? node.Method.GetGenericArguments() : null;
 
 
             //
             //
             // Check whether the method is compatible with the recursively rewritten instance
             // Check whether the method is compatible with the recursively rewritten instance
             // and arguments expressions. If so, create a new call expression.
             // and arguments expressions. If so, create a new call expression.
             //
             //
-            if ((node.Method.IsStatic || node.Method.DeclaringType.IsAssignableFrom(obj.Type)) && ArgsMatch(node.Method, args, typeArgs))
+            if ((node.Method.IsStatic || declType != null && declType.IsAssignableFrom(obj.Type)) && ArgsMatch(node.Method, args, typeArgs))
             {
             {
                 return Expression.Call(obj, node.Method, args);
                 return Expression.Call(obj, node.Method, args);
             }
             }
@@ -75,7 +76,7 @@ namespace System.Linq
             // Find a corresponding method in the non-expression world, e.g. rewriting from
             // Find a corresponding method in the non-expression world, e.g. rewriting from
             // the AsyncQueryable methods to the ones on AsyncEnumerable.
             // the AsyncQueryable methods to the ones on AsyncEnumerable.
             //
             //
-            if (node.Method.DeclaringType == typeof(AsyncQueryable))
+            if (declType == typeof(AsyncQueryable))
             {
             {
                 method = FindEnumerableMethod(node.Method.Name, args, typeArgs);
                 method = FindEnumerableMethod(node.Method.Name, args, typeArgs);
                 args = FixupQuotedArgs(method, args);
                 args = FixupQuotedArgs(method, args);
@@ -83,7 +84,12 @@ namespace System.Linq
             }
             }
             else
             else
             {
             {
-                method = FindMethod(node.Method.DeclaringType, node.Method.Name, args, typeArgs, BindingFlags.Static | (node.Method.IsPublic ? BindingFlags.Public : BindingFlags.NonPublic));
+                if (declType == null)
+                {
+                    throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, "Could not rewrite method with name '{0}' without a DeclaringType.", node.Method.Name));
+                }
+
+                method = FindMethod(declType, node.Method.Name, args, typeArgs, BindingFlags.Static | (node.Method.IsPublic ? BindingFlags.Public : BindingFlags.NonPublic));
                 args = FixupQuotedArgs(method, args);
                 args = FixupQuotedArgs(method, args);
             }
             }
 
 
@@ -215,7 +221,7 @@ namespace System.Linq
                 //
                 //
                 if (type.IsByRef)
                 if (type.IsByRef)
                 {
                 {
-                    type = type.GetElementType();
+                    type = type.GetElementType()!;
                 }
                 }
 
 
                 var expression = args[i];
                 var expression = args[i];
@@ -328,7 +334,7 @@ namespace System.Linq
                             var newArrayExpression = (NewArrayExpression)res;
                             var newArrayExpression = (NewArrayExpression)res;
 
 
                             var count = newArrayExpression.Expressions.Count;
                             var count = newArrayExpression.Expressions.Count;
-                            var elementType = type.GetElementType();
+                            var elementType = type.GetElementType()!;
                             var list = new List<Expression>(count);
                             var list = new List<Expression>(count);
 
 
                             for (var i = 0; i < count; i++)
                             for (var i = 0; i < count; i++)
@@ -357,7 +363,7 @@ namespace System.Linq
             //
             //
             // Array of quotes need to be stripped, so extract the element type.
             // Array of quotes need to be stripped, so extract the element type.
             //
             //
-            var elemType = type.IsArray ? type.GetElementType() : type;
+            var elemType = type.IsArray ? type.GetElementType()! : type;
 
 
             //
             //
             // Try to find Expression<T> and obtain T.
             // Try to find Expression<T> and obtain T.
@@ -454,7 +460,7 @@ namespace System.Linq
             return method;
             return method;
         }
         }
 
 
-        private static Type? FindGenericType(Type definition, Type type)
+        private static Type? FindGenericType(Type definition, Type? type)
         {
         {
             while (type != null && type != typeof(object))
             while (type != null && type != typeof(object))
             {
             {

文件差异内容过多而无法显示
+ 197 - 197
Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncQueryable.Generated.cs


+ 2 - 2
Ix.NET/Source/System.Linq.Async.Queryable/System/Linq/AsyncQueryable.cs

@@ -35,11 +35,11 @@ namespace System.Linq
         }
         }
 
 
 #if HAS_VALUETUPLE
 #if HAS_VALUETUPLE
-        private static MethodInfo s_Zip__TFirst_TSecond__2__0;
+        private static MethodInfo? s_Zip__TFirst_TSecond__2__0;
         
         
         private static MethodInfo Zip__TFirst_TSecond__2__0(Type TFirst, Type TSecond) =>
         private static MethodInfo Zip__TFirst_TSecond__2__0(Type TFirst, Type TSecond) =>
             (s_Zip__TFirst_TSecond__2__0 ??
             (s_Zip__TFirst_TSecond__2__0 ??
-            (s_Zip__TFirst_TSecond__2__0 = new Func<IAsyncQueryable<object>, IAsyncEnumerable<object>, IAsyncQueryable<ValueTuple<object, object>>>(Zip<object, object>).GetMethodInfo().GetGenericMethodDefinition())).MakeGenericMethod(TFirst, TSecond);
+            (s_Zip__TFirst_TSecond__2__0 = new Func<IAsyncQueryable<object>, IAsyncEnumerable<object>, IAsyncQueryable<ValueTuple<object, object>>>(Zip<object, object>).GetMethodInfo()!.GetGenericMethodDefinition())).MakeGenericMethod(TFirst, TSecond);
 
 
         public static IAsyncQueryable<(TFirst First, TSecond Second)> Zip<TFirst, TSecond>(this IAsyncQueryable<TFirst> first, IAsyncEnumerable<TSecond> second)
         public static IAsyncQueryable<(TFirst First, TSecond Second)> Zip<TFirst, TSecond>(this IAsyncQueryable<TFirst> first, IAsyncEnumerable<TSecond> second)
         {
         {

+ 4 - 10
Ix.NET/Source/System.Linq.Async.Tests/System.Linq.Async.Tests.csproj

@@ -2,17 +2,15 @@
 
 
   <PropertyGroup>
   <PropertyGroup>
     <TargetFrameworks>netcoreapp2.1;net461;netcoreapp3.0</TargetFrameworks>
     <TargetFrameworks>netcoreapp2.1;net461;netcoreapp3.0</TargetFrameworks>
-    <NoWarn>$(NoWarn);CS0618</NoWarn>
+    <NoWarn>$(NoWarn);CS0618;CS8603;CS8625</NoWarn>
   </PropertyGroup>
   </PropertyGroup>
 
 
-
   <ItemGroup>
   <ItemGroup>
     <Content Include="xunit.runner.json">
     <Content Include="xunit.runner.json">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>
   </ItemGroup>
   </ItemGroup>
 
 
-
   <ItemGroup>
   <ItemGroup>
     <None Include="System\Linq\Operators\Average.Generated.cs">
     <None Include="System\Linq\Operators\Average.Generated.cs">
       <DesignTime>True</DesignTime>
       <DesignTime>True</DesignTime>
@@ -41,13 +39,9 @@
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
-      <PrivateAssets>all</PrivateAssets>
-      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
-    </PackageReference>
-    <PackageReference Include="FluentAssertions" Version="5.6.0" />
-
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
+    <PackageReference Include="FluentAssertions" Version="5.9.0" />
     <PackageReference Include="xunit" Version="2.4.1" />
     <PackageReference Include="xunit" Version="2.4.1" />
   </ItemGroup>
   </ItemGroup>
 
 

+ 3 - 3
Ix.NET/Source/System.Linq.Async.Tests/System/Linq/AsyncEnumerableNamingTests.cs

@@ -68,9 +68,9 @@ namespace Tests
             static bool IsTaskLike(Type t) => IsTask(t) || IsValueTask(t);
             static bool IsTaskLike(Type t) => IsTask(t) || IsValueTask(t);
 
 
             static bool IsDelegate(Type t) => typeof(Delegate).IsAssignableFrom(t);
             static bool IsDelegate(Type t) => typeof(Delegate).IsAssignableFrom(t);
-            static bool TryGetInvoke(Type t, out MethodInfo m) => (m = t.GetMethod("Invoke")) != null;
-            static bool IsAsyncDelegate(Type t) => IsDelegate(t) && TryGetInvoke(t, out var i) && IsTaskLike(i.ReturnType);
-            static bool IsCancelableDelegate(Type t) => IsDelegate(t) && TryGetInvoke(t, out var i) && i.GetParameters().LastOrDefault()?.ParameterType == typeof(CancellationToken);
+            static bool TryGetInvoke(Type t, out MethodInfo? m) => (m = t.GetMethod("Invoke")) != null;
+            static bool IsAsyncDelegate(Type t) => IsDelegate(t) && TryGetInvoke(t, out var i) && IsTaskLike(i!.ReturnType);
+            static bool IsCancelableDelegate(Type t) => IsDelegate(t) && TryGetInvoke(t, out var i) && i!.GetParameters().LastOrDefault()?.ParameterType == typeof(CancellationToken);
             static DelegateKind GetDelegateKind(Type t) => IsAsyncDelegate(t) ? (IsCancelableDelegate(t) ? DelegateKind.AsyncCancel : DelegateKind.Async) : DelegateKind.Sync;
             static DelegateKind GetDelegateKind(Type t) => IsAsyncDelegate(t) ? (IsCancelableDelegate(t) ? DelegateKind.AsyncCancel : DelegateKind.Async) : DelegateKind.Sync;
         }
         }
 
 

+ 1 - 1
Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/GroupBy.cs

@@ -833,7 +833,7 @@ namespace Tests
                 return string.Equals(Key, other.Key) && Item == other.Item;
                 return string.Equals(Key, other.Key) && Item == other.Item;
             }
             }
 
 
-            public override bool Equals(object obj)
+            public override bool Equals(object? obj)
             {
             {
                 if (obj is null) return false;
                 if (obj is null) return false;
                 if (ReferenceEquals(this, obj)) return true;
                 if (ReferenceEquals(this, obj)) return true;

+ 4 - 4
Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/Join.cs

@@ -231,19 +231,19 @@ namespace Tests
 
 
         public class Customer
         public class Customer
         {
         {
-            public string CustomerId { get; set; }
+            public string? CustomerId { get; set; }
         }
         }
 
 
         public class Order
         public class Order
         {
         {
             public int OrderId { get; set; }
             public int OrderId { get; set; }
-            public string CustomerId { get; set; }
+            public string? CustomerId { get; set; }
         }
         }
 
 
         public class CustomerOrder : IEquatable<CustomerOrder>
         public class CustomerOrder : IEquatable<CustomerOrder>
         {
         {
             public int OrderId { get; set; }
             public int OrderId { get; set; }
-            public string CustomerId { get; set; }
+            public string? CustomerId { get; set; }
 
 
             public bool Equals(CustomerOrder other)
             public bool Equals(CustomerOrder other)
             {
             {
@@ -252,7 +252,7 @@ namespace Tests
                 return OrderId == other.OrderId && string.Equals(CustomerId, other.CustomerId);
                 return OrderId == other.OrderId && string.Equals(CustomerId, other.CustomerId);
             }
             }
 
 
-            public override bool Equals(object obj)
+            public override bool Equals(object? obj)
             {
             {
                 if (obj is null) return false;
                 if (obj is null) return false;
                 if (ReferenceEquals(this, obj)) return true;
                 if (ReferenceEquals(this, obj)) return true;

+ 8 - 8
Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/ToAsyncEnumerable.cs

@@ -177,7 +177,7 @@ namespace Tests
 
 
             Assert.NotNull(xc);
             Assert.NotNull(xc);
 
 
-            Assert.False(xc.IsReadOnly);
+            Assert.False(xc!.IsReadOnly);
 
 
             xc.Add(5);
             xc.Add(5);
 
 
@@ -202,7 +202,7 @@ namespace Tests
 
 
             Assert.NotNull(xl);
             Assert.NotNull(xl);
 
 
-            Assert.False(xl.IsReadOnly);
+            Assert.False(xl!.IsReadOnly);
 
 
             xl.Add(5);
             xl.Add(5);
 
 
@@ -286,7 +286,7 @@ namespace Tests
         [Fact]
         [Fact]
         public async Task ToAsyncEnumerable_Observable_Dispose()
         public async Task ToAsyncEnumerable_Observable_Dispose()
         {
         {
-            var stop = new ManualResetEvent(false);
+            using var stop = new ManualResetEvent(false);
 
 
             var xs = new MyObservable<int>(obs =>
             var xs = new MyObservable<int>(obs =>
             {
             {
@@ -320,9 +320,9 @@ namespace Tests
         [Fact]
         [Fact]
         public async Task ToAsyncEnumerable_Observable_Zip()
         public async Task ToAsyncEnumerable_Observable_Zip()
         {
         {
-            var subCount = 0;
+            using var stop = new ManualResetEvent(false);
 
 
-            var stop = new ManualResetEvent(false);
+            var subCount = 0;
 
 
             var xs = new MyObservable<int>(obs =>
             var xs = new MyObservable<int>(obs =>
             {
             {
@@ -360,7 +360,7 @@ namespace Tests
         [Fact]
         [Fact]
         public async Task ToAsyncEnumerable_Observable_Cancel()
         public async Task ToAsyncEnumerable_Observable_Cancel()
         {
         {
-            var stop = new ManualResetEvent(false);
+            using var stop = new ManualResetEvent(false);
 
 
             var xs = new MyObservable<int>(obs =>
             var xs = new MyObservable<int>(obs =>
             {
             {
@@ -380,7 +380,7 @@ namespace Tests
                 return new MyDisposable(cts.Cancel);
                 return new MyDisposable(cts.Cancel);
             }).ToAsyncEnumerable();
             }).ToAsyncEnumerable();
 
 
-            var c = new CancellationTokenSource();
+            using var c = new CancellationTokenSource();
 
 
             var e = xs.GetAsyncEnumerator(c.Token);
             var e = xs.GetAsyncEnumerator(c.Token);
 
 
@@ -396,7 +396,7 @@ namespace Tests
         [Fact]
         [Fact]
         public async Task ToAsyncEnumerable_Observable6_Async()
         public async Task ToAsyncEnumerable_Observable6_Async()
         {
         {
-            var stop = new ManualResetEvent(false);
+            using var stop = new ManualResetEvent(false);
 
 
             var xs = new MyObservable<int>(obs =>
             var xs = new MyObservable<int>(obs =>
             {
             {

+ 5 - 2
Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/ToLookup.cs

@@ -136,8 +136,11 @@ namespace Tests
             var xs = new[] { 1, 4, 2 }.ToAsyncEnumerable();
             var xs = new[] { 1, 4, 2 }.ToAsyncEnumerable();
             var res = await xs.ToLookupAsync(x => x % 2);
             var res = await xs.ToLookupAsync(x => x % 2);
 #pragma warning disable IDE0007 // Use implicit type
 #pragma warning disable IDE0007 // Use implicit type
-            foreach (IGrouping<int, int> g in (IEnumerable)res)
-                Assert.True(g.Key == 0 || g.Key == 1);
+            foreach (IGrouping<int, int>? g in (IEnumerable)res)
+            {
+                Assert.NotNull(g);
+                Assert.True(g!.Key == 0 || g!.Key == 1);
+            }
 #pragma warning restore IDE0007 // Use implicit type
 #pragma warning restore IDE0007 // Use implicit type
         }
         }
 
 

+ 18 - 9
Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/ToObservable.cs

@@ -22,8 +22,9 @@ namespace Tests
         [Fact]
         [Fact]
         public void ToObservable1()
         public void ToObservable1()
         {
         {
+            using var evt = new ManualResetEvent(false);
+
             var fail = false;
             var fail = false;
-            var evt = new ManualResetEvent(false);
 
 
             var xs = AsyncEnumerable.Empty<int>().ToObservable();
             var xs = AsyncEnumerable.Empty<int>().ToObservable();
             xs.Subscribe(new MyObserver<int>(
             xs.Subscribe(new MyObserver<int>(
@@ -49,9 +50,10 @@ namespace Tests
         [Fact]
         [Fact]
         public void ToObservable2()
         public void ToObservable2()
         {
         {
+            using var evt = new ManualResetEvent(false);
+
             var lst = new List<int>();
             var lst = new List<int>();
             var fail = false;
             var fail = false;
-            var evt = new ManualResetEvent(false);
 
 
             var xs = Return42.ToObservable();
             var xs = Return42.ToObservable();
             xs.Subscribe(new MyObserver<int>(
             xs.Subscribe(new MyObserver<int>(
@@ -78,9 +80,10 @@ namespace Tests
         [Fact]
         [Fact]
         public void ToObservable3()
         public void ToObservable3()
         {
         {
+            using var evt = new ManualResetEvent(false);
+
             var lst = new List<int>();
             var lst = new List<int>();
             var fail = false;
             var fail = false;
-            var evt = new ManualResetEvent(false);
 
 
             var xs = AsyncEnumerable.Range(0, 10).ToObservable();
             var xs = AsyncEnumerable.Range(0, 10).ToObservable();
             xs.Subscribe(new MyObserver<int>(
             xs.Subscribe(new MyObserver<int>(
@@ -107,10 +110,11 @@ namespace Tests
         [Fact]
         [Fact]
         public void ToObservable4()
         public void ToObservable4()
         {
         {
+            using var evt = new ManualResetEvent(false);
+
             var ex1 = new Exception("Bang!");
             var ex1 = new Exception("Bang!");
             var ex_ = default(Exception);
             var ex_ = default(Exception);
             var fail = false;
             var fail = false;
-            var evt = new ManualResetEvent(false);
 
 
             var xs = Throw<int>(ex1).ToObservable();
             var xs = Throw<int>(ex1).ToObservable();
             xs.Subscribe(new MyObserver<int>(
             xs.Subscribe(new MyObserver<int>(
@@ -138,8 +142,9 @@ namespace Tests
         [Fact]
         [Fact]
         public void ToObservable_DisposesEnumeratorOnCompletion()
         public void ToObservable_DisposesEnumeratorOnCompletion()
         {
         {
+            using var evt = new ManualResetEvent(false);
+
             var fail = false;
             var fail = false;
-            var evt = new ManualResetEvent(false);
 
 
             var ae = AsyncEnumerable.Create(
             var ae = AsyncEnumerable.Create(
                 _ => AsyncEnumerator.Create<int>(
                 _ => AsyncEnumerator.Create<int>(
@@ -170,8 +175,9 @@ namespace Tests
         [Fact]
         [Fact]
         public void ToObservable_DisposesEnumeratorWhenSubscriptionIsDisposed()
         public void ToObservable_DisposesEnumeratorWhenSubscriptionIsDisposed()
         {
         {
+            using var evt = new ManualResetEvent(false);
+
             var fail = false;
             var fail = false;
-            var evt = new ManualResetEvent(false);
             var subscription = default(IDisposable);
             var subscription = default(IDisposable);
             var subscriptionAssignedTcs = new TaskCompletionSource<object>();
             var subscriptionAssignedTcs = new TaskCompletionSource<object>();
 
 
@@ -194,7 +200,8 @@ namespace Tests
                 .Subscribe(new MyObserver<int>(
                 .Subscribe(new MyObserver<int>(
                     x =>
                     x =>
                     {
                     {
-                        subscription.Dispose();
+                        Assert.NotNull(subscription);
+                        subscription!.Dispose();
                     },
                     },
                     ex =>
                     ex =>
                     {
                     {
@@ -215,9 +222,10 @@ namespace Tests
         [Fact]
         [Fact]
         public void ToObservable_DesNotCallMoveNextAgainWhenSubscriptionIsDisposed()
         public void ToObservable_DesNotCallMoveNextAgainWhenSubscriptionIsDisposed()
         {
         {
+            using var evt = new ManualResetEvent(false);
+
             var fail = false;
             var fail = false;
             var moveNextCount = 0;
             var moveNextCount = 0;
-            var evt = new ManualResetEvent(false);
             var subscription = default(IDisposable);
             var subscription = default(IDisposable);
             var subscriptionAssignedTcs = new TaskCompletionSource<object>();
             var subscriptionAssignedTcs = new TaskCompletionSource<object>();
 
 
@@ -242,7 +250,8 @@ namespace Tests
                 .Subscribe(new MyObserver<int>(
                 .Subscribe(new MyObserver<int>(
                     x =>
                     x =>
                     {
                     {
-                        subscription.Dispose();
+                        Assert.NotNull(subscription);
+                        subscription!.Dispose();
                     },
                     },
                     ex =>
                     ex =>
                     {
                     {

+ 2 - 6
Ix.NET/Source/System.Linq.Async/System.Linq.Async.csproj

@@ -2,7 +2,6 @@
 
 
   <PropertyGroup>
   <PropertyGroup>
     <TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
     <TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
-    <NullableContextOptions>enable</NullableContextOptions>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
@@ -24,7 +23,8 @@
   </ItemGroup>
   </ItemGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Condition="'$(TargetFramework)' != 'netcoreapp3.0' and '$(TargetFramework)' != 'netstandard2.1' " Include="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0-preview6.19303.8" />
+    <PackageReference Condition="'$(TargetFramework)' != 'netcoreapp3.0' and '$(TargetFramework)' != 'netstandard2.1' " 
+                      Include="Microsoft.Bcl.AsyncInterfaces" Version="1.0.0" />
     <ReferenceAssemblyProjectReference Include="..\refs\System.Linq.Async.Ref\System.Linq.Async.Ref.csproj" />
     <ReferenceAssemblyProjectReference Include="..\refs\System.Linq.Async.Ref\System.Linq.Async.Ref.csproj" />
   </ItemGroup>
   </ItemGroup>
 
 
@@ -88,8 +88,4 @@
     </None>
     </None>
   </ItemGroup>
   </ItemGroup>
 
 
-  <ItemGroup>
-    <Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
-  </ItemGroup>
-
 </Project>
 </Project>

+ 16 - 16
Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.AsyncOverloads.cs

@@ -98,10 +98,10 @@ namespace System.Linq
         public static IOrderedAsyncEnumerable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByAwaitCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByAwaitCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector) => ThenByDescendingAwaitCore<TSource, TKey>(source, keySelector);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector) => ThenByDescendingAwaitCore<TSource, TKey>(source, keySelector);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByDescendingAwaitCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByDescendingAwaitCore<TSource, TKey>(source, keySelector, comparer);
-        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToDictionaryAwaitAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToDictionaryAwaitAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToDictionaryAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToDictionaryAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
@@ -198,10 +198,10 @@ namespace System.Linq
         public static IOrderedAsyncEnumerable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByAwaitWithCancellationCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenBy<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByAwaitWithCancellationCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector) => ThenByDescendingAwaitWithCancellationCore<TSource, TKey>(source, keySelector);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector) => ThenByDescendingAwaitWithCancellationCore<TSource, TKey>(source, keySelector);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByDescendingAwaitWithCancellationCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByDescendingAwaitWithCancellationCore<TSource, TKey>(source, keySelector, comparer);
-        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TElement>> ToLookupAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
@@ -298,10 +298,10 @@ namespace System.Linq
         public static IOrderedAsyncEnumerable<TSource> ThenByAwait<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByAwaitCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByAwait<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByAwaitCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescendingAwait<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector) => ThenByDescendingAwaitCore<TSource, TKey>(source, keySelector);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescendingAwait<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector) => ThenByDescendingAwaitCore<TSource, TKey>(source, keySelector);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescendingAwait<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByDescendingAwaitCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescendingAwait<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByDescendingAwaitCore<TSource, TKey>(source, keySelector, comparer);
-        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAwaitAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToDictionaryAwaitAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAwaitAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToDictionaryAwaitAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAwaitAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToDictionaryAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAwaitAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToDictionaryAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAwaitAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAwaitAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAwaitAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAwaitAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAwaitAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAwaitAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TElement>> ToLookupAwaitAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TElement>> ToLookupAwaitAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, Func<TSource, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAwaitAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAwaitAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToLookupAwaitAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
@@ -398,10 +398,10 @@ namespace System.Linq
         public static IOrderedAsyncEnumerable<TSource> ThenByAwaitWithCancellation<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByAwaitWithCancellationCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByAwaitWithCancellation<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByAwaitWithCancellationCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescendingAwaitWithCancellation<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector) => ThenByDescendingAwaitWithCancellationCore<TSource, TKey>(source, keySelector);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescendingAwaitWithCancellation<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector) => ThenByDescendingAwaitWithCancellationCore<TSource, TKey>(source, keySelector);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescendingAwaitWithCancellation<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByDescendingAwaitWithCancellationCore<TSource, TKey>(source, keySelector, comparer);
         public static IOrderedAsyncEnumerable<TSource> ThenByDescendingAwaitWithCancellation<TSource, TKey>(this IOrderedAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey> comparer) => ThenByDescendingAwaitWithCancellationCore<TSource, TKey>(source, keySelector, comparer);
-        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAwaitWithCancellationAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAwaitWithCancellationAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAwaitWithCancellationAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
-        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAwaitWithCancellationAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAwaitWithCancellationAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TSource>> ToDictionaryAwaitWithCancellationAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAwaitWithCancellationAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
+        public static ValueTask<Dictionary<TKey, TElement>> ToDictionaryAwaitWithCancellationAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) where TKey : notnull => ToDictionaryAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAwaitWithCancellationAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAwaitWithCancellationAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TElement>> ToLookupAwaitWithCancellationAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TElement>> ToLookupAwaitWithCancellationAsync<TSource, TKey, TElement>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, Func<TSource, CancellationToken, ValueTask<TElement>> elementSelector, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey, TElement>(source, keySelector, elementSelector, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAwaitWithCancellationAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);
         public static ValueTask<ILookup<TKey, TSource>> ToLookupAwaitWithCancellationAsync<TSource, TKey>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TKey>> keySelector, IEqualityComparer<TKey> comparer, CancellationToken cancellationToken = default) => ToLookupAwaitWithCancellationAsyncCore<TSource, TKey>(source, keySelector, comparer, cancellationToken);

+ 4 - 2
Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerable.AsyncOverloads.tt

@@ -109,8 +109,9 @@ foreach (var g in asyncMethods.GroupBy(m => m.Name.Contains("WithCancellation"))
         var isExtension = m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true);
         var isExtension = m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true);
         var pars = (isExtension ? "this " : "") + string.Join(", ", m.GetParameters().Select(p => toCSharp(p.ParameterType) + " " + p.Name + getOptionalSuffix(p)));
         var pars = (isExtension ? "this " : "") + string.Join(", ", m.GetParameters().Select(p => toCSharp(p.ParameterType) + " " + p.Name + getOptionalSuffix(p)));
         var args = string.Join(", ", m.GetParameters().Select(p => p.Name));
         var args = string.Join(", ", m.GetParameters().Select(p => p.Name));
+        var cons = m.Name.StartsWith("ToDictionary") ? " where TKey : notnull" : "";
 #>
 #>
-        public static <#=returnType#> <#=shortName#><#=genArgs#>(<#=pars#>) => <#=longName#><#=genArgs#>(<#=args#>);
+        public static <#=returnType#> <#=shortName#><#=genArgs#>(<#=pars#>)<#=cons#> => <#=longName#><#=genArgs#>(<#=args#>);
 <#
 <#
     }
     }
 
 
@@ -143,8 +144,9 @@ foreach (var g in asyncMethods.GroupBy(m => m.Name.Contains("WithCancellation"))
         var isExtension = m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true);
         var isExtension = m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true);
         var pars = (isExtension ? "this " : "") + string.Join(", ", m.GetParameters().Select(p => toCSharp(p.ParameterType) + " " + p.Name + getOptionalSuffix(p)));
         var pars = (isExtension ? "this " : "") + string.Join(", ", m.GetParameters().Select(p => toCSharp(p.ParameterType) + " " + p.Name + getOptionalSuffix(p)));
         var args = string.Join(", ", m.GetParameters().Select(p => p.Name));
         var args = string.Join(", ", m.GetParameters().Select(p => p.Name));
+        var cons = m.Name.StartsWith("ToDictionary") ? " where TKey : notnull" : "";
 #>
 #>
-        public static <#=returnType#> <#=shortName#><#=genArgs#>(<#=pars#>) => <#=longName#><#=genArgs#>(<#=args#>);
+        public static <#=returnType#> <#=shortName#><#=genArgs#>(<#=pars#>)<#=cons#> => <#=longName#><#=genArgs#>(<#=args#>);
 <#
 <#
     }
     }
 
 

+ 0 - 3
Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerablePartition.cs

@@ -25,7 +25,6 @@ namespace System.Linq
 
 
         internal AsyncEnumerablePartition(IAsyncEnumerable<TSource> source, int minIndexInclusive, int maxIndexInclusive)
         internal AsyncEnumerablePartition(IAsyncEnumerable<TSource> source, int minIndexInclusive, int maxIndexInclusive)
         {
         {
-            Debug.Assert(source != null);
             Debug.Assert(!(source is IList<TSource>), $"The caller needs to check for {nameof(IList<TSource>)}.");
             Debug.Assert(!(source is IList<TSource>), $"The caller needs to check for {nameof(IList<TSource>)}.");
             Debug.Assert(minIndexInclusive >= 0);
             Debug.Assert(minIndexInclusive >= 0);
             Debug.Assert(maxIndexInclusive >= -1);
             Debug.Assert(maxIndexInclusive >= -1);
@@ -373,8 +372,6 @@ namespace System.Linq
 
 
         private static async ValueTask<uint> SkipAndCountAsync(uint index, IAsyncEnumerator<TSource> en)
         private static async ValueTask<uint> SkipAndCountAsync(uint index, IAsyncEnumerator<TSource> en)
         {
         {
-            Debug.Assert(en != null);
-
             for (uint i = 0; i < index; i++)
             for (uint i = 0; i < index; i++)
             {
             {
                 if (!await en.MoveNextAsync().ConfigureAwait(false))
                 if (!await en.MoveNextAsync().ConfigureAwait(false))

+ 0 - 3
Ix.NET/Source/System.Linq.Async/System/Linq/AsyncEnumerator.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // 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. 
 // See the LICENSE file in the project root for more information. 
 
 
-using System.Diagnostics;
 using System.Linq;
 using System.Linq;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
@@ -67,8 +66,6 @@ namespace System.Collections.Generic
 
 
             public AnonymousAsyncIterator(Func<ValueTask<bool>> moveNext, Func<T> currentFunc, Func<ValueTask> dispose)
             public AnonymousAsyncIterator(Func<ValueTask<bool>> moveNext, Func<T> currentFunc, Func<ValueTask> dispose)
             {
             {
-                Debug.Assert(moveNext != null);
-
                 _moveNext = moveNext;
                 _moveNext = moveNext;
                 _currentFunc = currentFunc;
                 _currentFunc = currentFunc;
                 _dispose = dispose;
                 _dispose = dispose;

+ 1 - 1
Ix.NET/Source/System.Linq.Async/System/Linq/AsyncListPartition.cs

@@ -24,9 +24,9 @@ namespace System.Linq
 
 
         public AsyncListPartition(IList<TSource> source, int minIndexInclusive, int maxIndexInclusive)
         public AsyncListPartition(IList<TSource> source, int minIndexInclusive, int maxIndexInclusive)
         {
         {
-            Debug.Assert(source != null);
             Debug.Assert(minIndexInclusive >= 0);
             Debug.Assert(minIndexInclusive >= 0);
             Debug.Assert(minIndexInclusive <= maxIndexInclusive);
             Debug.Assert(minIndexInclusive <= maxIndexInclusive);
+
             _source = source;
             _source = source;
             _minIndexInclusive = minIndexInclusive;
             _minIndexInclusive = minIndexInclusive;
             _maxIndexInclusive = maxIndexInclusive;
             _maxIndexInclusive = maxIndexInclusive;

部分文件因为文件数量过多而无法显示