From: Michael D. <mik...@us...> - 2005-01-05 03:26:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23717/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Added a test for formula="" mapping. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** FooBarTest.cs 20 Dec 2004 05:06:30 -0000 1.77 --- FooBarTest.cs 5 Jan 2005 03:26:36 -0000 1.78 *************** *** 3601,3604 **** --- 3601,3622 ---- } + [Test] + public void Formula() + { + Foo foo = new Foo(); + ISession s = sessions.OpenSession(); + object id = s.Save( foo ); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + foo = (Foo)s.Find( "from Foo as f where f.id = ?", id, NHibernate.String)[0]; + Assert.AreEqual( 4, foo.Formula, "should be 2x 'Int' property that is defaulted to 2" ); + + s.Delete( foo ); + s.Flush(); + s.Close(); + } + } } |