Exemplo n.º 1
0
        public virtual void Test4Sort()
        {
            var baseName = GetBaseName();

            SetUp(baseName);
            var d = OdbConfiguration.GetIndexBTreeDegree();

            try
            {
                OdbConfiguration.SetIndexBTreeDegree(40);
                var odb = Open(baseName);
                var aq  =
                    odb.Query <VO.Login.Function>();

                (aq.Descend("name").Constrain("function 2").Equal()).Or(
                    aq.Descend("name").Constrain("function 3").Equal()).Not();

                aq.Descend("name").OrderDescending();

                var l = aq.Execute <VO.Login.Function>(true, -1, -1);
                odb.Close();

                AssertEquals(48, l.Count);
                var f = l.GetFirst();
                AssertEquals("function 9", f.GetName());
            }
            finally
            {
                OdbConfiguration.SetIndexBTreeDegree(d);
            }
        }
        public void Check_changing_btree_degree()
        {
            Assert.That(OdbConfiguration.GetIndexBTreeDegree(), Is.EqualTo(OdbConfiguration.DefaultIndexBTreeDegree));

            const int newIndexBTreeSize = 30;

            OdbConfiguration.SetIndexBTreeDegree(newIndexBTreeSize);

            Assert.That(OdbConfiguration.GetIndexBTreeDegree(), Is.EqualTo(newIndexBTreeSize));
        }