Skip to content

Commit 8439190

Browse files
committed
LazyProperty/LazyPropertyFixture.cs: Add test case CanUpdateNonLazyWithoutLoadingLazyProperty().
1 parent 47a0c12 commit 8439190

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/NHibernate.Test/LazyProperty/LazyPropertyFixture.cs

+23
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,28 @@ public void CanLoadAndSaveObjectInDifferentSessions()
130130
s.Merge(book);
131131
}
132132
}
133+
134+
135+
[Test]
136+
public void CanUpdateNonLazyWithoutLoadingLazyProperty()
137+
{
138+
Book book;
139+
using (ISession s = OpenSession())
140+
using (var trans = s.BeginTransaction())
141+
{
142+
book = s.Get<Book>(1);
143+
book.Name += "updated";
144+
145+
Assert.That(NHibernateUtil.IsPropertyInitialized(book, "ALotOfText"), Is.False);
146+
trans.Commit();
147+
}
148+
149+
150+
using (ISession s = OpenSession())
151+
{
152+
book = s.Get<Book>(1);
153+
Assert.That(book.Name, Is.EqualTo("some nameupdated"));
154+
}
155+
}
133156
}
134157
}

0 commit comments

Comments
 (0)