From: Michael D. <mik...@us...> - 2005-03-08 14:43:52
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20884 Modified Files: GetTest.cs Log Message: added test to verify call to Get() adds the entity to the session so it can be processed during a flush. Index: GetTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/GetTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GetTest.cs 11 Feb 2005 21:26:45 -0000 1.1 --- GetTest.cs 8 Mar 2005 14:43:41 -0000 1.2 *************** *** 46,49 **** --- 46,69 ---- } } + + [Test] + public void GetAndModify() + { + A a = new A( "name" ); + ISession s = sessions.OpenSession(); + s.Save( a ); + s.Close(); + + s = sessions.OpenSession(); + a = s.Get( typeof(A), a.Id ) as A; + a.Name = "modified"; + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + a = s.Get( typeof(A), a.Id ) as A; + Assert.AreEqual( "modified", a.Name, "the name was modified" ); + s.Close(); + } } } |