protected override void OnSetUp() { using (var s = OpenSession()) using (s.BeginTransaction()) { var test2 = new Test2(); test2.Cid = 5; test2.Description = "Test 2: CID = 5"; var test = new Test(); test.Cid = 1; test.Description = "Test: CID = 1"; test.Category = test2; s.Save(test2); s.Save(test); s.Transaction.Commit(); } }