Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects/Logging
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9465
Modified Files:
SimpleLoggingAdviceTests.cs
Log Message:
Index: SimpleLoggingAdviceTests.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects/Logging/SimpleLoggingAdviceTests.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SimpleLoggingAdviceTests.cs 8 Oct 2007 22:05:27 -0000 1.1
--- SimpleLoggingAdviceTests.cs 6 Dec 2007 06:45:33 -0000 1.2
***************
*** 34,38 ****
{
/// <summary>
! /// This calss contains tests for
/// </summary>
/// <author>Mark Pollack</author>
--- 34,38 ----
{
/// <summary>
! /// This class contains tests for SimpleLoggingAdvice
/// </summary>
/// <author>Mark Pollack</author>
***************
*** 77,80 ****
--- 77,109 ----
}
+ [Test]
+ public void SunnyDayLoggingCorrectlyDebugLevel()
+ {
+ ILog log = (ILog)mocks.CreateMock(typeof(ILog));
+ IMethodInvocation methodInvocation = (IMethodInvocation)mocks.CreateMock(typeof(IMethodInvocation));
+
+ MethodInfo mi = typeof(string).GetMethod("ToString", Type.EmptyTypes);
+ //two additional calls the method are to retrieve the method name on entry/exit...
+ Expect.Call(methodInvocation.Method).Return(mi).Repeat.Any();
+
+
+ Expect.Call(log.IsDebugEnabled).Return(true).Repeat.Any();
+ log.Debug("Entering ToString");
+
+
+ Expect.Call(methodInvocation.Proceed()).Return(null);
+
+ log.Debug("Exiting ToString, return=");
+
+ mocks.ReplayAll();
+
+ TestableSimpleLoggingAdvice loggingAdvice = new TestableSimpleLoggingAdvice(true);
+ loggingAdvice.LogLevel = LogLevel.Debug;
+ loggingAdvice.CallInvokeUnderLog(methodInvocation, log);
+
+ mocks.VerifyAll();
+
+ }
+
[Test]
|