From: Michael D. <mik...@us...> - 2005-04-05 14:21:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/UtilityTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8929/NHibernate.Test/UtilityTest Modified Files: ReflectHelperFixture.cs Log Message: NH-223: added method to load a type from an assembly with its partial name. Index: ReflectHelperFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/UtilityTest/ReflectHelperFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReflectHelperFixture.cs 20 Nov 2004 15:20:10 -0000 1.2 --- ReflectHelperFixture.cs 5 Apr 2005 14:21:20 -0000 1.3 *************** *** 28,31 **** --- 28,48 ---- Assert.IsTrue( ReflectHelper.OverridesEquals( typeof(BRhf) ), "Base class overrides equals" ); } + + [Test] + public void NoTypeFoundReturnsNull() + { + System.Type noType = ReflectHelper.TypeFromAssembly( "noclass", "noassembly" ); + Assert.IsNull( noType ); + } + + [Test] + public void TypeFoundInNotLoadedAssembly() + { + System.Type httpRequest = ReflectHelper.TypeFromAssembly( "System.Web.HttpRequest", "System.Web" ); + Assert.IsNotNull( httpRequest ); + + System.Type sameType = ReflectHelper.TypeFromAssembly( "System.Web.HttpRequest", "System.Web" ); + Assert.AreEqual( httpRequest, sameType, "should be the exact same Type" ); + } } |