Преглед изворни кода

Merge pull request #1036 from dotnet/dev/bartde/remove_unused_files

Remove duplicate test files
Bart J.F. De Smet пре 6 година
родитељ
комит
a197134645
40 измењених фајлова са 0 додато и 2831 уклоњено
  1. 0 88
      Ix.NET/Source/System.Interactive.Tests/BufferTest.cs
  2. 0 89
      Ix.NET/Source/System.Interactive.Tests/CaseTest.cs
  3. 0 210
      Ix.NET/Source/System.Interactive.Tests/CatchTest.cs
  4. 0 63
      Ix.NET/Source/System.Interactive.Tests/ConcatTest.cs
  5. 0 119
      Ix.NET/Source/System.Interactive.Tests/CreateTest.cs
  6. 0 53
      Ix.NET/Source/System.Interactive.Tests/DeferTest.cs
  7. 0 52
      Ix.NET/Source/System.Interactive.Tests/DistinctTest.cs
  8. 0 42
      Ix.NET/Source/System.Interactive.Tests/DistinctUntilChangedTest.cs
  9. 0 103
      Ix.NET/Source/System.Interactive.Tests/DoTest.cs
  10. 0 38
      Ix.NET/Source/System.Interactive.Tests/DoWhileTest.cs
  11. 0 43
      Ix.NET/Source/System.Interactive.Tests/ExpandTest.cs
  12. 0 86
      Ix.NET/Source/System.Interactive.Tests/FinallyTest.cs
  13. 0 40
      Ix.NET/Source/System.Interactive.Tests/ForEachTest.cs
  14. 0 27
      Ix.NET/Source/System.Interactive.Tests/ForTest.cs
  15. 0 30
      Ix.NET/Source/System.Interactive.Tests/GenerateTest.cs
  16. 0 30
      Ix.NET/Source/System.Interactive.Tests/HideTest.cs
  17. 0 49
      Ix.NET/Source/System.Interactive.Tests/IfTest.cs
  18. 0 29
      Ix.NET/Source/System.Interactive.Tests/IgnoreElementsTest.cs
  19. 0 33
      Ix.NET/Source/System.Interactive.Tests/IsEmptyTest.cs
  20. 0 36
      Ix.NET/Source/System.Interactive.Tests/MaxByTest.cs
  21. 0 36
      Ix.NET/Source/System.Interactive.Tests/MaxTest.cs
  22. 0 273
      Ix.NET/Source/System.Interactive.Tests/MemoizeTest.cs
  23. 0 38
      Ix.NET/Source/System.Interactive.Tests/MinByTest.cs
  24. 0 36
      Ix.NET/Source/System.Interactive.Tests/MinTest.cs
  25. 0 23
      Ix.NET/Source/System.Interactive.Tests/NopObserver.cs
  26. 0 86
      Ix.NET/Source/System.Interactive.Tests/OnErrorResumeNextTest.cs
  27. 0 284
      Ix.NET/Source/System.Interactive.Tests/PublishTest.cs
  28. 0 163
      Ix.NET/Source/System.Interactive.Tests/QueryableParityTest.cs
  29. 0 55
      Ix.NET/Source/System.Interactive.Tests/RepeatTest.cs
  30. 0 55
      Ix.NET/Source/System.Interactive.Tests/RetryTest.cs
  31. 0 21
      Ix.NET/Source/System.Interactive.Tests/ReturnTest.cs
  32. 0 36
      Ix.NET/Source/System.Interactive.Tests/ScanTest.cs
  33. 0 27
      Ix.NET/Source/System.Interactive.Tests/SelectManyTest.cs
  34. 0 125
      Ix.NET/Source/System.Interactive.Tests/ShareTest.cs
  35. 0 58
      Ix.NET/Source/System.Interactive.Tests/SkipLastTest.cs
  36. 0 38
      Ix.NET/Source/System.Interactive.Tests/StartWithTest.cs
  37. 0 73
      Ix.NET/Source/System.Interactive.Tests/TakeLastTest.cs
  38. 0 31
      Ix.NET/Source/System.Interactive.Tests/ThrowTest.cs
  39. 0 75
      Ix.NET/Source/System.Interactive.Tests/UsingTest.cs
  40. 0 38
      Ix.NET/Source/System.Interactive.Tests/WhileTest.cs

+ 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);
-        }
-    }
-}

+ 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]));
-        }
-    }
-}