Browse Source

Cleaning up some test code.

Bart De Smet 8 years ago
parent
commit
24991b228c

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

@@ -636,4 +636,4 @@ namespace Tests
         }
 
     }
-}
+}

+ 3 - 2
Ix.NET/Source/System.Interactive.Async.Tests/AssertEx.cs

@@ -1,6 +1,7 @@
 // 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 Xunit;
 using System;
 
@@ -37,7 +38,7 @@ namespace Tests
         {
             try
             {
-                action();   
+                action();
             }
             catch (AggregateException ex)
             {
@@ -47,4 +48,4 @@ namespace Tests
             }
         }
     }
-}
+}

+ 4 - 0
Ix.NET/Source/System.Interactive.Async.Tests/AsyncEnumerableQueryTest.cs

@@ -1,3 +1,7 @@
+// 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.Linq;
 using Xunit;
 

+ 5 - 1
Ix.NET/Source/System.Interactive.Async.Tests/AsyncQueryableExTests.Generated.cs

@@ -1,4 +1,8 @@
-using System;
+// 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 System.Linq.Expressions;

+ 5 - 1
Ix.NET/Source/System.Interactive.Async.Tests/AsyncQueryableExTests.Generated.tt

@@ -1,4 +1,8 @@
-<#@ template debug="false" hostspecific="false" language="C#" #>
+// 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. 
+
+<#@ template debug="false" hostspecific="false" language="C#" #>
 <#@ assembly name="System.Core" #>
 <#@ assembly name="$(ProjectDir)\..\System.Linq.Async\bin\$(Configuration)\net46\System.Linq.Async.dll" #>
 <#@ assembly name="$(ProjectDir)\..\System.Interactive.Async\bin\$(Configuration)\net46\System.Interactive.Async.dll" #>

+ 5 - 1
Ix.NET/Source/System.Interactive.Async.Tests/AsyncQueryableTests.Generated.cs

@@ -1,4 +1,8 @@
-using System;
+// 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 System.Linq.Expressions;

+ 5 - 1
Ix.NET/Source/System.Interactive.Async.Tests/AsyncQueryableTests.Generated.tt

@@ -1,4 +1,8 @@
-<#@ template debug="false" hostspecific="false" language="C#" #>
+// 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. 
+
+<#@ template debug="false" hostspecific="false" language="C#" #>
 <#@ assembly name="System.Core" #>
 <#@ assembly name="$(ProjectDir)\..\System.Linq.Async\bin\$(Configuration)\net46\System.Linq.Async.dll" #>
 <#@ import namespace="System.Linq" #>

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

@@ -2205,4 +2205,4 @@ namespace Tests
             AssertThrows<Exception>(() => xs.Wait(WaitTimeoutMs), ex_ => ((AggregateException)ex_).Flatten().InnerExceptions.Single() == ex);
         }
     }
-}
+}

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

@@ -288,4 +288,4 @@ namespace Tests
         }
 
     }
-}
+}

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

@@ -4,12 +4,10 @@
 
 using System;
 using System.Collections.Generic;
-using System.Collections.ObjectModel;
 using System.Linq;
-using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using Xunit;
-using System.Threading;
 
 namespace Tests
 {
@@ -171,11 +169,11 @@ namespace Tests
             var xs = set.ToAsyncEnumerable();
 
             var xc = xs as ICollection<int>;
-            
+
             Assert.NotNull(xc);
 
             Assert.False(xc.IsReadOnly);
-            
+
             xc.Add(5);
 
 
@@ -590,4 +588,4 @@ namespace Tests
             }
         }
     }
-}
+}

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

@@ -423,4 +423,4 @@ namespace Tests
             }
         }
     }
-}
+}

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

@@ -400,9 +400,9 @@ namespace Tests
             await SequenceIdentity(xs);
             Assert.Equal(2, i);
         }
-    
 
-    [Fact]
+
+        [Fact]
         public void OnErrorResumeNext_Null()
         {
             AssertThrows<ArgumentNullException>(() => AsyncEnumerableEx.OnErrorResumeNext<int>(default(IAsyncEnumerable<int>), AsyncEnumerable.Return(42)));

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

@@ -622,7 +622,7 @@ namespace Tests
                 throw new NotImplementedException();
             }
         }
-        
+
         [Fact]
         public void GroupJoin_Null()
         {
@@ -729,7 +729,8 @@ namespace Tests
             var xs = new[] { 0, 1, 2 }.ToAsyncEnumerable();
             var ys = new[] { 3, 6, 4 }.ToAsyncEnumerable();
 
-            var res = xs.GroupJoin(ys, x => x % 3, y => y % 3, (x, i) => {
+            var res = xs.GroupJoin(ys, x => x % 3, y => y % 3, (x, i) =>
+            {
                 if (x == 1)
                     throw ex;
                 return x + " - " + i.Aggregate("", (s, j) => s + j).Result;

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

@@ -4,12 +4,11 @@
 
 using System;
 using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
 using System.Linq;
-using System.Text;
-using Xunit;
 using System.Threading;
 using System.Threading.Tasks;
+using Xunit;
+
 namespace Tests
 {
 
@@ -251,7 +250,7 @@ namespace Tests
         {
             var xs = new[] { 8, 5, 7, 4, 6, 9, 2, 1, 0 }.ToAsyncEnumerable();
             var ys = xs.Where(x => x % 2 == 0);
-            
+
             await SequenceIdentity(ys);
         }
 
@@ -563,7 +562,7 @@ namespace Tests
         [Fact]
         public void Cast2()
         {
-            var xs = new [] { new EventArgs(), new EventArgs(), new EventArgs() }.ToAsyncEnumerable();
+            var xs = new[] { new EventArgs(), new EventArgs(), new EventArgs() }.ToAsyncEnumerable();
             var ys = xs.Cast<EventArgs>();
 
             Assert.Same(xs, ys);
@@ -1333,7 +1332,7 @@ namespace Tests
         public async Task DefaultIfEmpty11()
         {
             var xs = AsyncEnumerable.Empty<int>().DefaultIfEmpty(42);
-            
+
             Assert.Equal(1, await xs.Count());
         }
 
@@ -1415,8 +1414,8 @@ namespace Tests
         public async Task Distinct3()
         {
             var xs = new[] { 1, 2, 1, 3, 5, 2, 1, 4 }.ToAsyncEnumerable().Distinct();
-            
-            var res = new [] { 1, 2, 3, 5, 4 };
+
+            var res = new[] { 1, 2, 3, 5, 4 };
             Assert.True(res.SequenceEqual(await xs.ToArray()));
         }
 
@@ -1433,7 +1432,7 @@ namespace Tests
         public async Task Distinct5()
         {
             var xs = new[] { 1, 2, 1, 3, 5, 2, 1, 4 }.ToAsyncEnumerable().Distinct();
-            
+
             Assert.Equal(5, await xs.Count());
         }
 
@@ -1485,7 +1484,7 @@ namespace Tests
             var xs = AsyncEnumerable.Empty<int>().Distinct(k => k);
 
             var e = xs.GetAsyncEnumerator();
-            
+
             NoNext(e);
         }
 
@@ -1988,7 +1987,7 @@ namespace Tests
             //var g2e = g2.GetEnumerator();
             //HasNext(g2e, 43);
 
-            
+
             //AssertThrows<Exception>(() => g1e.MoveNext().Wait(WaitTimeoutMs), ex_ => ((AggregateException)ex_).Flatten().InnerExceptions.Single().Message == "Bang!");
             //AssertThrows<Exception>(() => g2e.MoveNext().Wait(WaitTimeoutMs), ex_ => ((AggregateException)ex_).Flatten().InnerExceptions.Single().Message == "Bang!");
         }
@@ -2010,7 +2009,7 @@ namespace Tests
             //HasNext(g1e, 42);
             //AssertThrows<Exception>(() => g1e.MoveNext().Wait(WaitTimeoutMs), ex_ => ((AggregateException)ex_).Flatten().InnerExceptions.Single().Message == "Bang!");
 
-                    
+
         }
 
         static IEnumerable<int> GetXs()
@@ -2054,7 +2053,7 @@ namespace Tests
             //var g2e = g2.GetEnumerator();
             //HasNext(g2e, 2);
 
-           
+
             //AssertThrows<Exception>(() => g1e.MoveNext().Wait(WaitTimeoutMs), ex_ => ((AggregateException)ex_).Flatten().InnerExceptions.Single() == ex);
             //AssertThrows<Exception>(() => g2e.MoveNext().Wait(WaitTimeoutMs), ex_ => ((AggregateException)ex_).Flatten().InnerExceptions.Single() == ex);
         }
@@ -2326,7 +2325,7 @@ namespace Tests
 
             var ys = xs.ToAsyncEnumerable();
 
-            var res = ys.GroupBy(x => x.Item/10);
+            var res = ys.GroupBy(x => x.Item / 10);
 
             await SequenceIdentity(res);
         }
@@ -2359,7 +2358,7 @@ namespace Tests
         {
             var xs = AsyncEnumerable.Range(0, 10);
             var ys = xs.GroupBy(x => x % 3, x => (char)('a' + x), (k, cs) => k + " - " + cs.Aggregate("", (a, c) => a + c).Result);
-            
+
             Assert.Equal(3, await ys.Count());
         }
 
@@ -2388,7 +2387,7 @@ namespace Tests
 
             var gg1 = gar[0];
             var gg1a = await gg1.ToArray();
-            
+
             Assert.Equal(g1a, gg1a);
 
             var gg2 = gar[1];
@@ -2398,7 +2397,7 @@ namespace Tests
 
             var gg3 = gar[2];
             var gg3a = await gg3.ToArray();
-            Assert.Equal(g3a, gg3a); 
+            Assert.Equal(g3a, gg3a);
         }
 
         [Fact]
@@ -2433,7 +2432,7 @@ namespace Tests
         {
             var xs = AsyncEnumerable.Range(0, 10);
             var ys = xs.GroupBy(x => x % 3, x => (char)('a' + x));
-            
+
             var gar = await ys.ToList();
 
             Assert.Equal(3, gar.Count);
@@ -2632,7 +2631,7 @@ namespace Tests
             {
                 unchecked
                 {
-                    return ((Key != null ? Key.GetHashCode() : 0)*397) ^ Item;
+                    return ((Key != null ? Key.GetHashCode() : 0) * 397) ^ Item;
                 }
             }
 
@@ -3270,7 +3269,7 @@ namespace Tests
             var xs = new[] { 1, 2, 3, 4 }.ToAsyncEnumerable().TakeLast(0);
 
             var e = xs.GetAsyncEnumerator();
-            
+
             NoNext(e);
         }
 
@@ -3322,4 +3321,4 @@ namespace Tests
             NoNext(e);
         }
     }
-}
+}

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

@@ -1,6 +1,7 @@
 // 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

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

@@ -1,6 +1,7 @@
 // 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 Xunit;
 using System;
 using System.Collections.Generic;
@@ -52,4 +53,3 @@ namespace Tests
         }
     }
 }
-