From: Michael D. <mik...@us...> - 2004-12-20 05:06:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16662/NHibernate.Test Modified Files: FooBarTest.cs Log Message: more work on test fixture. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** FooBarTest.cs 16 Dec 2004 21:56:06 -0000 1.76 --- FooBarTest.cs 20 Dec 2004 05:06:30 -0000 1.77 *************** *** 842,846 **** //The special property (lowercase) id may be used to reference the unique identifier of an object. (You may also use its property name.) string hqlString = "from s in class Stuff where s.Foo.id = ? and s.id.Id = ? and s.MoreStuff.id.IntId = ? and s.MoreStuff.id.StringId = ?"; ! object[] values = new object[] {bar, (long)1234, (int)12, "id" }; Type.IType[] types = new Type.IType[] { --- 842,846 ---- //The special property (lowercase) id may be used to reference the unique identifier of an object. (You may also use its property name.) string hqlString = "from s in class Stuff where s.Foo.id = ? and s.id.Id = ? and s.MoreStuff.id.IntId = ? and s.MoreStuff.id.StringId = ?"; ! object[] values = new object[] {bar, (long)1234, 12, "id" }; Type.IType[] types = new Type.IType[] { *************** *** 1819,1824 **** s.Find( "from Baz baz left join baz.FooToGlarch join fetch baz.FooSet foo left join fetch foo.TheFoo" ); ! //TODO: resume h2.0.3 - line 1613 } [Test] --- 1819,1861 ---- s.Find( "from Baz baz left join baz.FooToGlarch join fetch baz.FooSet foo left join fetch foo.TheFoo" ); ! // foo.Boolean = true ! list = s.Find( "from foo in class NHibernate.DomainModel.Foo where foo.String='osama bin laden' and foo.Boolean = 1 order by foo.String asc, foo.Component.Count desc" ); ! Assert.AreEqual( 0, list.Count, "empty query" ); ! IEnumerable enumer = s.Enumerable( "from foo in class NHibernate.DomainModel.Foo where foo.String='osama bin laden' order by foo.String asc, foo.Component.Count desc" ); ! Assert.IsFalse( enumer.GetEnumerator().MoveNext(), "empty enumerator" ); ! ! list = s.Find( "select foo.TheFoo from foo in class NHibernate.DomainModel.Foo" ); ! Assert.AreEqual( 1, list.Count, "query" ); ! Assert.AreEqual( foo.TheFoo, list[0], "returned object" ); ! foo.TheFoo.TheFoo = foo; ! foo.String = "fizard"; ! ! // the following test is disabled for databases with no subselects...also for Interbase (not sure why) - h2.0.3 ! // also HSQLDialect, MckoiDialect, SAPDBDialect, PointbaseDialect ! if( !(dialect is Dialect.MySQLDialect) ) ! { ! // add an !InterbaseDialect wrapper around list and assert ! list = s.Find( "from foo in class NHibernate.DomainModel.Foo where ? = some foo.Component.ImportantDates.elements", new DateTime( DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day ), NHibernate.DateTime ); ! Assert.AreEqual( 2, list.Count, "componenet query" ); ! } ! ! // WAS: 3 in h2.0.3 - there's a null value at index 2 that is not in the db with hibernate - it is a missing index ! // in the db ! list = s.Find( "from foo in class NHibernate.DomainModel.Foo where size(foo.Component.ImportantDates) = 4" ); ! Assert.AreEqual( 2, list.Count, "component query" ); ! list = s.Find( "from foo in class Foo where 0 = size(foo.Component.ImportantDates)" ); ! Assert.AreEqual( 0, list.Count, "component query" ); ! list = s.Find( "from foo in class Foo where exists elements(foo.Component.ImportantDates)" ); ! Assert.AreEqual( 2, list.Count, "component query" ); ! s.Find( "from foo in class Foo where not exists (from bar in class Bar where bar.id = foo.id)" ); ! ! s.Find( "select foo.TheFoo from foo in class Foo where foo = some(select x from x in class Foo where x.Long > foo.TheFoo.Long)" ); ! s.Find( "from foo in class Foo where foo = some(select x from x in class Foo where x.Long > foo.TheFoo.Long) and foo.TheFoo.String='baz'" ); ! s.Find( "from foo in class Foo where foo.TheFoo.String='baz' and foo = some(select x from x in class Foo where x.Long>foo.TheFoo.Long)" ); ! s.Find( "from foo in class Foo where foo = some(select x from x in class Foo where x.Long > foo.TheFoo.Long)" ); ! ! s.Enumerable( "select foo.String, foo.Date, foo.TheFoo.String, foo.id from foo in class Foo, baz in class Baz where foo in elements(baz.FooArray) and foo.String like 'foo'" ); } + // line 1645 [Test] *************** *** 2908,2912 **** g2.ProxyArray = new GlarchProxy[] { null, g3, g }; - object emptyObject = new object(); Iesi.Collections.ISet hashset = new Iesi.Collections.HashedSet(); hashset.Add( g1 ); --- 2945,2948 ---- *************** *** 3502,3506 **** baz.FooArray = new Foo[] { bar, bar2 }; - object emptyObject = new object(); Iesi.Collections.ISet hashset = new Iesi.Collections.HashedSet(); bar = new Bar(); --- 3538,3541 ---- |