Exemplo n.º 1
0
        public void SelectFirstOrDefault90()
        {
            var root = new QTreeNode <int>(1);

            root.Insert(new QTreeNode <int>(2));
            root.Child(0).Insert(new QTreeNode <int>(3));
            root.Insert(new QTreeNode <int>(4));
            root.Insert(new QTreeNode <int>(5));
            root.Child(2).Insert(new QTreeNode <int>(6));
            root.Child(2).Child(0).Insert(new QTreeNode <int>(7));
            Assert.True(root.SelectFirstOrDefault(x => x == 90) == 0, "root.SelectFirstOrDefault(x => x == 90) == 0");
        }
Exemplo n.º 2
0
        public void SelectFirstOrDefaultNotFound()
        {
            var root = new QTreeNode <int>(1);

            root.Insert(new QTreeNode <int>(2));
            root.Child(0).Insert(new QTreeNode <int>(3));
            root.Insert(new QTreeNode <int>(4));
            root.Insert(new QTreeNode <int>(5));
            root.Child(2).Insert(new QTreeNode <int>(6));
            root.Child(2).Child(0).Insert(new QTreeNode <int>(7));
            Assert.True(root.SelectFirstOrDefault(x => x == 123) == default(int),
                        "root.SelectFirstOrDefault(x => x == 123) == 123");
        }