From: Michael D. <mik...@us...> - 2004-11-24 14:35:10
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24376/src/NHibernate.Test Modified Files: MasterDetailTest.cs Log Message: trying to duplicate collection refresh problem. Index: MasterDetailTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MasterDetailTest.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MasterDetailTest.cs 18 Nov 2004 02:46:59 -0000 1.16 --- MasterDetailTest.cs 24 Nov 2004 14:34:45 -0000 1.17 *************** *** 703,706 **** --- 703,719 ---- c = (Category) s.Load( typeof(Category), id ); Assert.AreEqual( 1, c.Subcategories.Count ); + + // modify the collection in another session + ISession s2 = sessions.OpenSession(); + Category c2 = (Category)s2.Load( typeof(Category), id ); + c2.Subcategories.Add( new Category() ); + s2.Flush(); + s2.Close(); + + // now lets refresh the collection and see if it picks up + // the new objects + s.Refresh( c ); + Assert.AreEqual( 2, c.Subcategories.Count, "should have gotten the addition from s2" ); + s.Delete(c); s.Flush(); |