public void NestedParents()
        {
            ActiveRecordStarter.Initialize(GetConfigSource(),
                typeof(NestedParent), typeof(NestedInner));
            Recreate();

            NestedParent.DeleteAll();

            NestedParent nestedParent = new NestedParent();
            nestedParent.Save();

            nestedParent = NestedParent.Find(nestedParent.Id);
            Assert.AreEqual(1, nestedParent.Id);
            Assert.IsNull(nestedParent.Inner);

            nestedParent.Inner = new NestedInner();
            nestedParent.Inner.DateProp = DateTime.Today.AddDays(-10);
            nestedParent.Inner.IntProp = 12;
            nestedParent.Save();
            Assert.IsNotNull(nestedParent.Inner);

            using (new SessionScope())
            {
                NestedParent nestedParentFromDb = NestedParent.Find(nestedParent.Id);
                Assert.AreEqual(nestedParent.Inner.DateProp.Date, nestedParentFromDb.Inner.DateProp.Date, "DateProp not the same");
                Assert.AreEqual(nestedParent.Inner.IntProp, nestedParentFromDb.Inner.IntProp, "IntProp not the same	");
            }
        }
        public void NestedParents()
        {
            ActiveRecordStarter.Initialize(GetConfigSource(),
                                           typeof(NestedParent), typeof(NestedInner));
            Recreate();

            NestedParent.DeleteAll();

            NestedParent nestedParent = new NestedParent();

            nestedParent.Save();

            nestedParent = NestedParent.Find(nestedParent.Id);
            Assert.AreEqual(1, nestedParent.Id);
            Assert.IsNull(nestedParent.Inner);

            nestedParent.Inner          = new NestedInner();
            nestedParent.Inner.DateProp = DateTime.Today.AddDays(-10);
            nestedParent.Inner.IntProp  = 12;
            nestedParent.Save();
            Assert.IsNotNull(nestedParent.Inner);

            using (new SessionScope())
            {
                NestedParent nestedParentFromDb = NestedParent.Find(nestedParent.Id);
                Assert.AreEqual(nestedParent.Inner.DateProp.Date, nestedParentFromDb.Inner.DateProp.Date, "DateProp not the same");
                Assert.AreEqual(nestedParent.Inner.IntProp, nestedParentFromDb.Inner.IntProp, "IntProp not the same	");
            }
        }