コード例 #1
0
        public void Recurse()
        {
            var r1 = new Recursive(1,
                                   new Recursive(2,
                                                 new Recursive(4)),
                                   new Recursive(3));

            var recursives = r1.Recurse(r => r.Recursives).ToArray();

            Assert.IsTrue(recursives.Select(x => x.Value).SequenceEqual(new[] { 1, 2, 4, 3 }));
        }
コード例 #2
0
        public void TestRecursivePopulationThreeLevel()
        {
            var r1 = new Recursive(1,
                                   new Recursive(2,
                                                 new Recursive(4)),
                                   new Recursive(3));

            var recursives = r1.Recurse(r => r.Recursives).ToArray();

            Assert.AreEqual(4, recursives.Length);
            Assert.IsTrue(recursives.Select(x => x.Value).SequenceEqual(new[] { 1, 2, 4, 3 }));
        }
コード例 #3
0
        public void Recurse()
        {
            var r1 = new Recursive(1,
                        new Recursive(2,
                            new Recursive(4)),
                        new Recursive(3));

            var recursives = r1.Recurse(r => r.Recursives).ToArray();

            Assert.IsTrue(recursives.Select(x => x.Value).SequenceEqual(new[] { 1, 2, 4, 3 }));
        }
コード例 #4
0
        public void TestRecursivePopulationThreeLevel()
        {
            var r1 = new Recursive(1,
                        new Recursive(2,
                            new Recursive(4)),
                        new Recursive(3));

            var recursives = r1.Recurse(r => r.Recursives).ToArray();

            Assert.AreEqual(4, recursives.Length);
            Assert.IsTrue(recursives.Select(x => x.Value).SequenceEqual(new[] { 1, 2, 4, 3 }));
        }