Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4835/NHibernate.Test
Modified Files:
FooBarTest.cs
Log Message:
Does <set> work? Expects IDictionary, in original expected TreeSet, which is IList.
Index: FooBarTest.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** FooBarTest.cs 15 Apr 2004 09:30:16 -0000 1.9
--- FooBarTest.cs 15 Apr 2004 15:11:01 -0000 1.10
***************
*** 35,39 ****
[Test]
! //[Ignore("Generated SQL contains bad quoting")]
public void FetchInitializedCollection()
{
--- 35,39 ----
[Test]
! //[Ignore("Generated SQL contains bad quoting")]
public void FetchInitializedCollection()
{
***************
*** 66,69 ****
--- 66,94 ----
}
+ [Test]
+ public void Sortables()
+ {
+ ISession s = sessions.OpenSession();
+ Baz b = new Baz();
+ IDictionary ss = new Hashtable();
+ ss.Add(b, new Sortable[] {new Sortable("foo") });
+ // ss.Add(b, new Sortable("bar") );
+ // ss.Add(b, new Sortable("baz") );
+ b.sortablez = ss;
+ s.Save(b);
+ s.Flush();
+ s.Close();
+
+ s = sessions.OpenSession();
+ IList result = s.CreateCriteria(typeof(Baz))
+ .AddOrder( Expression.Order.Asc("name") )
+ .List();
+ b = (Baz) result[0];
+ Assert.IsTrue( b.sortablez.Count==3 );
+ Assert.AreEqual( ( (Sortable) b.sortablez[0] ).name, "bar" );
+ s.Flush();
+ s.Close();
+ }
+
}
}
|