public void SingleRelationshipSavesAndSelects() { _testName = System.Reflection.MethodInfo.GetCurrentMethod().Name.GetHashCode().ToString(); var seed = new Seed32(); List<MockClassE> objs = null; var ids = new List<int>(); using (var fLock = new ManagedFileLock(_testName)) { Cleanup(); using (var db = new RelationalDatabase<int, MockClassD>(_testName + ".database", "Id")) { db.Load(); using (var t = db.BeginTransaction()) { objs = TestResourceFactory.GetMockClassDObjects(3, db).ToList(); objs.ToList().ForEach(o => o.Id = db.Add(o)); t.Commit(); } } using (var db = new RelationalDatabase<int, MockClassD>(_testName + ".database")) { db.Load(); var first = db.SelectFirst(s => s.Value<int>("Id") > 0, 50); foreach (var obj in objs) AssertMockClassE((MockClassE)first.First(f => f.Id == obj.Id), obj as MockClassE, db); var last = db.SelectLast(s => s.Value<int>("Id") > 0, 50); foreach (var obj in objs) AssertMockClassE((MockClassE)last.First(f => f.Id == obj.Id), obj as MockClassE, db); } } }