Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Util
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv337
Modified Files:
ReflectionUtilsTests.cs
Log Message:
ContextRegistry.GetContext() / WebApplicationContext.Current should print a detailed error [SPRNET-475].
Index: ReflectionUtilsTests.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsTests.cs,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** ReflectionUtilsTests.cs 20 Sep 2007 12:31:01 -0000 1.18
--- ReflectionUtilsTests.cs 5 Oct 2007 17:06:32 -0000 1.19
***************
*** 701,704 ****
--- 701,748 ----
#endregion
+ #region GetExplicitBaseException
+
+ [Test]
+ public void GetExplicitBaseExceptionWithNoInnerException()
+ {
+ Exception appEx = new ApplicationException();
+ Exception ex = ReflectionUtils.GetExplicitBaseException(appEx);
+
+ Assert.AreEqual(ex, appEx);
+ }
+
+ [Test]
+ public void GetExplicitBaseExceptionWithInnerException()
+ {
+ Exception dbzEx = new DivideByZeroException();
+ Exception appEx = new ApplicationException("Test message", dbzEx);
+ Exception ex = ReflectionUtils.GetExplicitBaseException(appEx);
+
+ Assert.AreEqual(ex, dbzEx);
+ }
+
+ [Test]
+ public void GetExplicitBaseExceptionWithInnerExceptions()
+ {
+ Exception dbzEx = new DivideByZeroException();
+ Exception sEx = new SystemException("Test message", dbzEx);
+ Exception appEx = new ApplicationException("Test message", sEx);
+ Exception ex = ReflectionUtils.GetExplicitBaseException(appEx);
+
+ Assert.AreEqual(ex, dbzEx);
+ }
+
+ [Test]
+ public void GetExplicitBaseExceptionWithNullReferenceExceptionAsRootException()
+ {
+ Exception nrEx = new NullReferenceException();
+ Exception appEx = new ApplicationException("Test message", nrEx);
+ Exception ex = ReflectionUtils.GetExplicitBaseException(appEx);
+
+ Assert.AreEqual(ex, appEx);
+ }
+
+ #endregion
+
#region Helper Methods
|