Exemplo n.º 1
0
 public virtual void Test1()
 {
     var baseName = GetBaseName();
     var odb = Open(baseName);
     MyObjectWithMyHashCode my = null;
     // creates 1000 objects
     for (var i = 0; i < 1000; i++)
     {
         my = new MyObjectWithMyHashCode(Convert.ToInt64(1000));
         odb.Store(my);
     }
     odb.Close();
     odb = Open(baseName);
     var query1 = odb.Query<MyObjectWithMyHashCode>();
     var objects = query1.Execute<MyObjectWithMyHashCode>();
     AssertEquals(1000, objects.Count);
     while (objects.HasNext())
     {
         my = objects.Next();
         odb.Delete(my);
     }
     odb.Close();
     odb = Open(baseName);
     var query = odb.Query<MyObjectWithMyHashCode>();
     objects = query.Execute<MyObjectWithMyHashCode>();
     odb.Close();
     OdbFactory.Delete(baseName);
     AssertEquals(0, objects.Count);
 }
Exemplo n.º 2
0
        public virtual void Test1()
        {
            var baseName = GetBaseName();
            var odb      = Open(baseName);
            MyObjectWithMyHashCode my = null;

            // creates 1000 objects
            for (var i = 0; i < 1000; i++)
            {
                my = new MyObjectWithMyHashCode(Convert.ToInt64(1000));
                odb.Store(my);
            }
            odb.Close();
            odb = Open(baseName);
            var query1  = odb.Query <MyObjectWithMyHashCode>();
            var objects = query1.Execute <MyObjectWithMyHashCode>();

            AssertEquals(1000, objects.Count);
            while (objects.HasNext())
            {
                my = objects.Next();
                odb.Delete(my);
            }
            odb.Close();
            odb = Open(baseName);
            var query = odb.Query <MyObjectWithMyHashCode>();

            objects = query.Execute <MyObjectWithMyHashCode>();
            odb.Close();
            OdbFactory.Delete(baseName);
            AssertEquals(0, objects.Count);
        }