Пример #1
0
        public static void Main(string[] args)
        {
            Print(10, FibSupplier.Stream().ToFunc());
            Print(20, FibSupplier.Func());

            Print(10, PrimesSupplier.Stream().ToFunc());
            Print(20, PrimesSupplier.Func());
        }
Пример #2
0
        public void FuncTest()
        {
            int[] expected1 = { 2, 3, 5, 7, 11, 13, 17 };
            Assert.Equal(expected1, PrimesSupplier.Stream().Take(expected1.Length));
            int[] expected = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31 };
            var   primes   = ToIterator(PrimesSupplier.Func()).Take(expected.Length).ToArray();

            Assert.Equal(expected, primes);
        }