浏览代码

Moving Empty tests.

Bart De Smet 8 年之前
父节点
当前提交
f74ccee73e

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

@@ -19,6 +19,13 @@ namespace Tests
     {
         private const int WaitTimeoutMs = 5000;
 
+        [Fact]
+        public async Task IsEmpty_Null()
+        {
+            await Assert.ThrowsAsync<ArgumentNullException>(() => AsyncEnumerableEx.IsEmpty<int>(null));
+            await Assert.ThrowsAsync<ArgumentNullException>(() => AsyncEnumerableEx.IsEmpty<int>(null, CancellationToken.None));
+        }
+
         [Fact]
         public async Task First_Null()
         {

+ 0 - 24
Ix.NET/Source/System.Interactive.Async.Tests/AsyncTests.Creation.cs

@@ -49,30 +49,6 @@ namespace Tests
             await e.DisposeAsync();
         }
 
-        [Fact]
-        public async Task Empty_Null()
-        {
-            await Assert.ThrowsAsync<ArgumentNullException>(() => AsyncEnumerableEx.IsEmpty<int>(null));
-            await Assert.ThrowsAsync<ArgumentNullException>(() => AsyncEnumerableEx.IsEmpty<int>(null, CancellationToken.None));
-        }
-
-        [Fact]
-        public void Empty1()
-        {
-            var xs = AsyncEnumerable.Empty<int>();
-            NoNext(xs.GetAsyncEnumerator());
-        }
-
-        [Fact]
-        public void Empty2()
-        {
-            var xs = AsyncEnumerable.Empty<int>();
-
-            var e = xs.GetAsyncEnumerator();
-            Assert.False(e.MoveNextAsync().Result);
-            AssertThrows<InvalidOperationException>(() => Nop(e.Current));
-        }
-
         [Fact]
         public void Throw_Null()
         {

+ 34 - 0
Ix.NET/Source/System.Linq.Async.Tests/System/Linq/Operators/Empty.cs

@@ -0,0 +1,34 @@
+// 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.Linq;
+using Xunit;
+
+namespace Tests
+{
+    public class Empty : AsyncEnumerableTests
+    {
+        [Fact]
+        public void Empty1()
+        {
+            var xs = AsyncEnumerable.Empty<int>();
+            NoNext(xs.GetAsyncEnumerator());
+        }
+
+        [Fact]
+        public void Empty2()
+        {
+            var xs = AsyncEnumerable.Empty<int>();
+
+            var e = xs.GetAsyncEnumerator();
+            Assert.False(e.MoveNextAsync().Result);
+            AssertThrows<InvalidOperationException>(() => Nop(e.Current));
+        }
+
+        private void Nop(object o)
+        {
+        }
+    }
+}