public virtual void Test2() { string baseName = GetBaseName(); NeoDatis.Odb.ODB odb = Open(baseName); NeoDatis.Odb.Test.Cache.MyObjectWithMyHashCode2 my = null; // creates 1000 objects for (int i = 0; i < 1000; i++) { my = new NeoDatis.Odb.Test.Cache.MyObjectWithMyHashCode2(System.Convert.ToInt64(1000 )); odb.Store(my); } odb.Close(); odb = Open(baseName); NeoDatis.Odb.Objects <MyObjectWithMyHashCode2> objects = odb.GetObjects<MyObjectWithMyHashCode2>(); AssertEquals(1000, objects.Count); while (objects.HasNext()) { my = (NeoDatis.Odb.Test.Cache.MyObjectWithMyHashCode2)objects.Next(); odb.Delete(my); } odb.Close(); odb = Open(baseName); objects = odb.GetObjects<MyObjectWithMyHashCode2>(); odb.Close(); NeoDatis.Tool.IOUtil.DeleteFile(baseName); AssertEquals(0, objects.Count); }
/// <summary>a problem reported by glsender</summary> /// <exception cref="System.Exception"></exception> public virtual void Test2() { string baseName = GetBaseName(); NeoDatis.Odb.ODB odb = Open(baseName); NeoDatis.Odb.Test.Cache.MyObjectWithMyHashCode2 my = null; // creates 1000 objects for (int i = 0; i < 1000; i++) { my = new NeoDatis.Odb.Test.Cache.MyObjectWithMyHashCode2(System.Convert.ToInt64(1000 )); odb.Store(my); } odb.Close(); odb = Open(baseName); NeoDatis.Odb.Objects objects = odb.GetObjects(typeof(NeoDatis.Odb.Test.Cache.MyObjectWithMyHashCode2 )); AssertEquals(1000, objects.Count); while (objects.HasNext()) { my = (NeoDatis.Odb.Test.Cache.MyObjectWithMyHashCode2)objects.Next(); odb.Delete(my); } odb.Close(); odb = Open(baseName); objects = odb.GetObjects(typeof(NeoDatis.Odb.Test.Cache.MyObjectWithMyHashCode2)); odb.Close(); NeoDatis.Tool.IOUtil.DeleteFile(baseName); AssertEquals(0, objects.Count); }