diff --git a/Spring.Net.2008.sln b/Spring.Net.2008.sln index 982b141c..9aa3e572 100644 --- a/Spring.Net.2008.sln +++ b/Spring.Net.2008.sln @@ -5,7 +5,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution BreakingChanges-1.2.txt = BreakingChanges-1.2.txt changelog.txt = changelog.txt readme.txt = readme.txt - Spring.build = Spring.build Spring.include = Spring.include EndProjectSection EndProject diff --git a/lib/Net/1.1/DotNetMock.Framework.dll b/lib/Net/1.1/DotNetMock.Framework.dll index 181c37da..b91f079f 100644 Binary files a/lib/Net/1.1/DotNetMock.Framework.dll and b/lib/Net/1.1/DotNetMock.Framework.dll differ diff --git a/lib/Net/1.1/DotNetMock.dll b/lib/Net/1.1/DotNetMock.dll index 5e94669b..794065d3 100644 Binary files a/lib/Net/1.1/DotNetMock.dll and b/lib/Net/1.1/DotNetMock.dll differ diff --git a/lib/Net/2.0/DotNetMock.Framework.dll b/lib/Net/2.0/DotNetMock.Framework.dll index 181c37da..b91f079f 100644 Binary files a/lib/Net/2.0/DotNetMock.Framework.dll and b/lib/Net/2.0/DotNetMock.Framework.dll differ diff --git a/lib/Net/2.0/DotNetMock.dll b/lib/Net/2.0/DotNetMock.dll index 5e94669b..794065d3 100644 Binary files a/lib/Net/2.0/DotNetMock.dll and b/lib/Net/2.0/DotNetMock.dll differ diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AbstractMethodInvocationTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AbstractMethodInvocationTests.cs index 950f89c6..bfd6b2e6 100644 --- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AbstractMethodInvocationTests.cs +++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AbstractMethodInvocationTests.cs @@ -28,6 +28,7 @@ using System.Reflection; using AopAlliance.Intercept; using DotNetMock.Dynamic; using NUnit.Framework; +using Rhino.Mocks; #endregion @@ -166,16 +167,29 @@ namespace Spring.Aop.Framework [Test] public void ValidInvocation() - { + {/* Target target = new Target(); + MockRepository repository = new MockRepository(); + IMethodInterceptor interceptor = (IMethodInterceptor) repository.CreateMock(typeof (IMethodInterceptor)); + AbstractMethodInvocation join = CreateMethodInvocation( + null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new object[] { interceptor }); + Expect.Call(interceptor.Invoke(join)).Return(target.BullseyeMethod().ToLower(CultureInfo.InvariantCulture)); + repository.ReplayAll(); + string score = (string) join.Proceed(); + Assert.AreEqual(target.BullseyeMethod().ToLower(CultureInfo.InvariantCulture) + Target.Suffix, score); + repository.VerifyAll(); + */ + + Target target = new Target(); IDynamicMock mock = new DynamicMock(typeof (IMethodInterceptor)); AbstractMethodInvocation join = CreateMethodInvocation( null, target, target.GetTargetMethodNoArgs(), null, null, target.GetType(), new object[] { mock.Object }); - mock.ExpectAndReturn("Invoke", target.BullseyeMethod().ToLower(CultureInfo.InvariantCulture)); + mock.ExpectAndReturn("Invoke", target.BullseyeMethod().ToLower(CultureInfo.InvariantCulture), null); string score = (string) join.Proceed(); Assert.AreEqual(Target.DefaultScore.ToLower(CultureInfo.InvariantCulture) + Target.Suffix, score); mock.Verify(); + } [Test] @@ -205,7 +219,7 @@ namespace Spring.Aop.Framework IDynamicMock mock = new DynamicMock(typeof (IMethodInterceptor)); AbstractMethodInvocation join = CreateMethodInvocation( null, target, target.GetTargetMethod(), null, null, target.GetType(), new object[] { mock.Object }); - mock.ExpectAndReturn("Invoke", null); + mock.ExpectAndReturn("Invoke", null, null); try { join.Proceed(); @@ -228,7 +242,7 @@ namespace Spring.Aop.Framework IDynamicMock mock = new DynamicMock(typeof (IMethodInterceptor)); AbstractMethodInvocation join = CreateMethodInvocation( null, target, target.GetTargetMethod(), null, null, target.GetType(), new object[] { mock.Object }); - mock.ExpectAndThrow("Invoke", new NotImplementedException()); + mock.ExpectAndThrow("Invoke", new NotImplementedException(), null); try { join.Proceed(); diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/AfterReturningAdviceInterceptorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/AfterReturningAdviceInterceptorTests.cs index bc50b3c5..323842cc 100644 --- a/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/AfterReturningAdviceInterceptorTests.cs +++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/AfterReturningAdviceInterceptorTests.cs @@ -22,8 +22,9 @@ using System; using AopAlliance.Intercept; -using DotNetMock.Dynamic; using NUnit.Framework; +using Rhino.Mocks; +using Spring.Util; #endregion @@ -47,50 +48,67 @@ namespace Spring.Aop.Framework.Adapter [Test] public void IsNotInvokedIfServiceObjectThrowsException() { - IDynamicMock mockAdvice = new DynamicMock(typeof (IAfterReturningAdvice)); - IAfterReturningAdvice afterAdvice = (IAfterReturningAdvice) mockAdvice.Object; + MockRepository repository = new MockRepository(); + IMethodInvocation mockInvocation = (IMethodInvocation)repository.CreateMock(typeof(IMethodInvocation)); + IAfterReturningAdvice mockAdvice = (IAfterReturningAdvice)repository.CreateMock(typeof(IAfterReturningAdvice)); + mockAdvice.AfterReturning(null, null, null, null); + LastCall.IgnoreArguments(); + LastCall.Throw(new FormatException()); - IDynamicMock mockInvocation = new DynamicMock(typeof (IMethodInvocation)); - IMethodInvocation invocation = (IMethodInvocation) mockInvocation.Object; - mockInvocation.ExpectAndThrow("Proceed", new FormatException(), null); + Expect.Call(mockInvocation.Method).Return(ReflectionUtils.GetMethod(typeof(object), "HashCode", new Type[] { })); + Expect.Call(mockInvocation.Arguments).Return(null); + Expect.Call(mockInvocation.This).Return(new object()); + Expect.Call(mockInvocation.Proceed()).Return(null); - try - { - AfterReturningAdviceInterceptor interceptor = new AfterReturningAdviceInterceptor(afterAdvice); - interceptor.Invoke(invocation); - Assert.Fail("Must have thrown a FormatException by this point."); - } - catch (FormatException) - { - } + repository.ReplayAll(); + + try + { + AfterReturningAdviceInterceptor interceptor = new AfterReturningAdviceInterceptor(mockAdvice); + interceptor.Invoke(mockInvocation); + Assert.Fail("Must have thrown a FormatException by this point."); + } + catch (FormatException) + { + } + + repository.VerifyAll(); - mockAdvice.Verify(); // must not have been called... - mockInvocation.Verify(); } [Test] public void JustPassesAfterReturningAdviceExceptionUpWithoutAnyWrapping() { - IDynamicMock mockAdvice = new DynamicMock(typeof (IAfterReturningAdvice)); - IAfterReturningAdvice afterAdvice = (IAfterReturningAdvice) mockAdvice.Object; - mockAdvice.ExpectAndThrow("AfterReturning", new FormatException(), new object[] { null, null, null, null}); - IDynamicMock mockInvocation = new DynamicMock(typeof (IMethodInvocation)); - IMethodInvocation invocation = (IMethodInvocation) mockInvocation.Object; - mockInvocation.ExpectAndReturn("Proceed", null); + MockRepository repository = new MockRepository(); + IMethodInvocation mockInvocation = (IMethodInvocation)repository.CreateMock(typeof(IMethodInvocation)); + IAfterReturningAdvice mockAdvice = (IAfterReturningAdvice) repository.CreateMock(typeof (IAfterReturningAdvice)); + mockAdvice.AfterReturning(null,null,null,null); + LastCall.IgnoreArguments(); + LastCall.Throw(new FormatException()); + + Expect.Call(mockInvocation.Method).Return(ReflectionUtils.GetMethod(typeof(object), "HashCode", new Type[] { })); + Expect.Call(mockInvocation.Arguments).Return(null); + Expect.Call(mockInvocation.This).Return(new object()); + Expect.Call(mockInvocation.Proceed()).Return(null); + + repository.ReplayAll(); + + try + { + AfterReturningAdviceInterceptor interceptor = new AfterReturningAdviceInterceptor(mockAdvice); + interceptor.Invoke(mockInvocation); + Assert.Fail("Must have thrown a FormatException by this point."); + } + catch (FormatException) + { + } + repository.VerifyAll(); + + + - try - { - AfterReturningAdviceInterceptor interceptor = new AfterReturningAdviceInterceptor(afterAdvice); - interceptor.Invoke(invocation); - Assert.Fail("Must have thrown a FormatException by this point."); - } - catch (FormatException) - { - } - mockAdvice.Verify(); - mockInvocation.Verify(); } } } \ No newline at end of file diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/ThrowsAdviceInterceptorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/ThrowsAdviceInterceptorTests.cs index 4eb9c444..6d5f6fcc 100644 --- a/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/ThrowsAdviceInterceptorTests.cs +++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/Adapter/ThrowsAdviceInterceptorTests.cs @@ -27,6 +27,8 @@ using System.Web; using AopAlliance.Intercept; using DotNetMock.Dynamic; using NUnit.Framework; +using Rhino.Mocks; +using Spring.Util; #endregion @@ -57,65 +59,79 @@ namespace Spring.Aop.Framework.Adapter [Test] public void NotInvoked() { - MyThrowsHandler th = new MyThrowsHandler(); - ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); - object ret = new object(); + MockRepository repository = new MockRepository(); + IMethodInvocation mi = (IMethodInvocation) repository.CreateMock(typeof (IMethodInvocation)); + + MyThrowsHandler th = new MyThrowsHandler(); + ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); + object ret = new object(); + + Expect.Call(mi.Proceed()).Return(ret); + repository.ReplayAll(); + Assert.AreEqual(ret, ti.Invoke(mi)); + Assert.AreEqual(0, th.GetCalls()); + repository.VerifyAll(); + + - IDynamicMock mc = new DynamicMock(typeof (IMethodInvocation)); - IMethodInvocation mi = (IMethodInvocation) mc.Object; - mi.Proceed(); - mc.SetValue("Proceed", ret); - Assert.AreEqual(ret, ti.Invoke(mi)); - Assert.AreEqual(0, th.GetCalls()); - mc.Verify(); } [Test] public void NoHandlerMethodForThrowable() - { - MyThrowsHandler th = new MyThrowsHandler(); - ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); - Assert.AreEqual(2, ti.HandlerMethodCount); - Exception ex = new Exception(); - IDynamicMock mc = new DynamicMock(typeof (IMethodInvocation)); - IMethodInvocation mi = (IMethodInvocation) mc.Object; - mi.Proceed(); - mc.ExpectAndThrow("Proceed", ex, null); - try - { - ti.Invoke(mi); - Assert.Fail(); - } - catch (Exception caught) - { - Assert.AreEqual(ex, caught); - } - Assert.AreEqual(0, th.GetCalls()); - mc.Verify(); + { + MyThrowsHandler th = new MyThrowsHandler(); + ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); + Assert.AreEqual(2, ti.HandlerMethodCount); + Exception ex = new Exception(); + + MockRepository repository = new MockRepository(); + IMethodInvocation mi = (IMethodInvocation)repository.CreateMock(typeof(IMethodInvocation)); + Expect.Call(mi.Proceed()).Throw(ex); + repository.ReplayAll(); + try + { + ti.Invoke(mi); + Assert.Fail(); + } + catch (Exception caught) + { + Assert.AreEqual(ex, caught); + } + Assert.AreEqual(0, th.GetCalls()); + repository.VerifyAll(); + } [Test] public void CorrectHandlerUsed() { - MyThrowsHandler th = new MyThrowsHandler(); - ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); - HttpException ex = new HttpException(); - IDynamicMock mc = new DynamicMock(typeof (IMethodInvocation)); - IMethodInvocation mi = (IMethodInvocation) mc.Object; - mi.Proceed(); - mc.ExpectAndThrow("Proceed", ex, null); - try - { - ti.Invoke(mi); - Assert.Fail(); - } - catch (Exception caught) - { - Assert.AreEqual(ex, caught); - } - Assert.AreEqual(1, th.GetCalls()); - Assert.AreEqual(1, th.GetCalls("HttpException")); - mc.Verify(); + + MyThrowsHandler th = new MyThrowsHandler(); + ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); + HttpException ex = new HttpException(); + + MockRepository repository = new MockRepository(); + IMethodInvocation mi = (IMethodInvocation)repository.CreateMock(typeof(IMethodInvocation)); + + Expect.Call(mi.Method).Return(ReflectionUtils.GetMethod(typeof (object), "HashCode", new Type[] {})); + Expect.Call(mi.Arguments).Return(null); + Expect.Call(mi.This).Return(new object()); + Expect.Call(mi.Proceed()).Throw(ex); + repository.ReplayAll(); + try + { + ti.Invoke(mi); + Assert.Fail(); + } + catch (Exception caught) + { + Assert.AreEqual(ex, caught); + } + Assert.AreEqual(1, th.GetCalls()); + Assert.AreEqual(1, th.GetCalls("HttpException")); + + repository.VerifyAll(); + } [Test] @@ -125,10 +141,10 @@ namespace Spring.Aop.Framework.Adapter ThrowsAdviceInterceptor throwsInterceptor = new ThrowsAdviceInterceptor(throwsHandler); // nest the exceptions; make sure the advice gets applied because of the inner exception... Exception exception = new FormatException("Parent", new HttpException("Inner")); - IDynamicMock mockInvocation = new DynamicMock(typeof (IMethodInvocation)); - IMethodInvocation invocation = (IMethodInvocation) mockInvocation.Object; - invocation.Proceed(); - mockInvocation.ExpectAndThrow("Proceed", exception, null); + MockRepository repository = new MockRepository(); + IMethodInvocation invocation = (IMethodInvocation)repository.CreateMock(typeof(IMethodInvocation)); + Expect.Call(invocation.Proceed()).Throw(exception); + repository.ReplayAll(); try { throwsInterceptor.Invoke(invocation); @@ -144,7 +160,7 @@ namespace Spring.Aop.Framework.Adapter Assert.AreEqual(0, throwsHandler.GetCalls("HttpException"), "Similarly, must NOT have been handled, 'cos the HttpException was wrapped by " + "another Exception that did not have a handler."); - mockInvocation.Verify(); + repository.VerifyAll(); } [Test] @@ -158,52 +174,56 @@ namespace Spring.Aop.Framework.Adapter [Test] public void CorrectHandlerUsedForSubclass() { - MyThrowsHandler th = new MyThrowsHandler(); - ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); - // Extends RemotingException - RemotingTimeoutException ex = new RemotingTimeoutException(); - IDynamicMock mc = new DynamicMock(typeof (IMethodInvocation)); - IMethodInvocation mi = (IMethodInvocation) mc.Object; - mi.Proceed(); - mc.ExpectAndThrow("Proceed", ex, null); - try - { - ti.Invoke(mi); - Assert.Fail(); - } - catch (Exception caught) - { - Assert.AreEqual(ex, caught); - } - Assert.AreEqual(1, th.GetCalls()); - Assert.AreEqual(1, th.GetCalls("RemotingException")); - mc.Verify(); + MyThrowsHandler th = new MyThrowsHandler(); + ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th); + // Extends RemotingException + RemotingTimeoutException ex = new RemotingTimeoutException(); + + MockRepository repository = new MockRepository(); + IMethodInvocation mi = (IMethodInvocation)repository.CreateMock(typeof(IMethodInvocation)); + Expect.Call(mi.Proceed()).Throw(ex); + repository.ReplayAll(); + try + { + ti.Invoke(mi); + Assert.Fail(); + } + catch (Exception caught) + { + Assert.AreEqual(ex, caught); + } + Assert.AreEqual(1, th.GetCalls()); + Assert.AreEqual(1, th.GetCalls("RemotingException")); + + repository.VerifyAll(); } [Test] public void HandlerMethodThrowsException() - { - Exception exception = new Exception(); - MyThrowsHandler handler = new ThrowingMyHandler(exception); - ThrowsAdviceInterceptor interceptor = new ThrowsAdviceInterceptor(handler); - // extends RemotingException... - RemotingTimeoutException ex = new RemotingTimeoutException(); - IDynamicMock mc = new DynamicMock(typeof (IMethodInvocation)); - IMethodInvocation invocation = (IMethodInvocation) mc.Object; - invocation.Proceed(); - mc.ExpectAndThrow("Proceed", ex, null); - try - { - interceptor.Invoke(invocation); - Assert.Fail("Should not have reached this point, should have thrown an exception."); - } - catch (Exception caught) - { - Assert.AreEqual(exception, caught); - } - Assert.AreEqual(1, handler.GetCalls()); - Assert.AreEqual(1, handler.GetCalls("RemotingException")); - mc.Verify(); + { + Exception exception = new Exception(); + MyThrowsHandler handler = new ThrowingMyHandler(exception); + ThrowsAdviceInterceptor interceptor = new ThrowsAdviceInterceptor(handler); + // extends RemotingException... + RemotingTimeoutException ex = new RemotingTimeoutException(); + + MockRepository repository = new MockRepository(); + IMethodInvocation mi = (IMethodInvocation)repository.CreateMock(typeof(IMethodInvocation)); + Expect.Call(mi.Proceed()).Throw(ex); + repository.ReplayAll(); + try + { + interceptor.Invoke(mi); + Assert.Fail("Should not have reached this point, should have thrown an exception."); + } + catch (Exception caught) + { + Assert.AreEqual(exception, caught); + } + Assert.AreEqual(1, handler.GetCalls()); + Assert.AreEqual(1, handler.GetCalls("RemotingException")); + repository.VerifyAll(); + } #region Helper Classes diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs index 953b5490..bcdf568b 100644 --- a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs +++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs @@ -580,7 +580,7 @@ namespace Spring.Aop.Framework NopInterceptor advice = new NopInterceptor(); IDynamicMock mock = new DynamicMock(typeof(IObjectFactory)); - mock.ExpectAndReturn("IsSingleton", true); // advice is a singleton... + mock.ExpectAndReturn("IsSingleton", true, "advice"); // advice is a singleton... mock.ExpectAndReturn("GetObject", advice, "advice"); mock.ExpectAndReturn("GetType", typeof(GoodCommand), "prototype"); diff --git a/test/Spring/Spring.Aop.Tests/Aop/Target/PrototypeTargetSourceTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Target/PrototypeTargetSourceTests.cs index 63515083..d1d08cf3 100644 --- a/test/Spring/Spring.Aop.Tests/Aop/Target/PrototypeTargetSourceTests.cs +++ b/test/Spring/Spring.Aop.Tests/Aop/Target/PrototypeTargetSourceTests.cs @@ -81,8 +81,8 @@ namespace Spring.Aop.Target { SideEffectObject target = new SideEffectObject(); IDynamicMock mock = new DynamicMock(typeof (IObjectFactory)); - mock.ExpectAndReturn("IsPrototype", true); - mock.ExpectAndReturn("GetType", typeof(SideEffectObject)); + mock.ExpectAndReturn("IsPrototype", true, null); + mock.ExpectAndReturn("GetType", typeof(SideEffectObject), null); PrototypeTargetSource source = new PrototypeTargetSource(); source.ObjectFactory = (IObjectFactory) mock.Object; Assert.AreEqual(target.GetType(), source.TargetType, "Wrong TargetType being returned."); @@ -119,10 +119,12 @@ namespace Spring.Aop.Target public void GetTarget() { SideEffectObject target = new SideEffectObject(); - IDynamicMock mock = new DynamicMock(typeof (IObjectFactory)); - mock.ExpectAndReturn("IsPrototype", true); - mock.ExpectAndReturn("GetObject", target); + IDynamicMock mock = new DynamicMock(typeof (IObjectFactory));; + mock.ExpectAndReturn("IsPrototype", true, "foo"); + mock.ExpectAndReturn("GetObject", target, "foo"); + mock.ExpectAndReturn("GetType", typeof (string), "foo"); PrototypeTargetSource source = new PrototypeTargetSource(); + source.TargetObjectName = "foo"; source.ObjectFactory = (IObjectFactory) mock.Object; Assert.IsTrue(object.ReferenceEquals(source.GetTarget(), target), "Initial target source reference not being returned by GetTarget()."); diff --git a/test/Spring/Spring.Aop.Tests/Aspects/Exception/ExceptionHandlerAspectIntegrationTests.cs b/test/Spring/Spring.Aop.Tests/Aspects/Exception/ExceptionHandlerAspectIntegrationTests.cs index 8f90e0a8..21b2dfd6 100644 --- a/test/Spring/Spring.Aop.Tests/Aspects/Exception/ExceptionHandlerAspectIntegrationTests.cs +++ b/test/Spring/Spring.Aop.Tests/Aspects/Exception/ExceptionHandlerAspectIntegrationTests.cs @@ -271,12 +271,12 @@ namespace Spring.Aspects.Exceptions } catch (InvalidOperationException e) { - Assert.IsInstanceOfType(typeof(ArithmeticException), e.InnerException, "Inner exception."); + Assert.That(e.InnerException, Is.InstanceOf(typeof(ArithmeticException)), "Inner exception."); Assert.AreEqual("My Message, Method Name Exceptional", e.Message); } catch (Exception e) { - Assert.IsInstanceOfType(typeof(InvalidOperationException), e, "wrong exception type thrown."); + Assert.That(e, Is.InstanceOf(typeof (InvalidOperationException)), "wrong exception type thrown."); } } @@ -294,12 +294,12 @@ namespace Spring.Aspects.Exceptions } catch (InvalidOperationException e) { - Assert.IsInstanceOfType(typeof(ArithmeticException), e.InnerException); + Assert.That(e.InnerException, Is.InstanceOf(typeof(ArithmeticException))); Assert.AreEqual("My Message", e.Message); } catch (Exception e) { - Assert.IsInstanceOfType(typeof(InvalidOperationException), e); + Assert.That(e, Is.InstanceOf(typeof(InvalidOperationException))); } } @@ -317,12 +317,11 @@ namespace Spring.Aspects.Exceptions } catch (InvalidOperationException e) { - Assert.IsInstanceOfType(typeof(ArithmeticException), e.InnerException); Assert.AreEqual("Wrapped ArithmeticException", e.Message); } catch (Exception e) { - Assert.IsInstanceOfType(typeof(InvalidOperationException), e); + Assert.That(e, Is.InstanceOf(typeof(InvalidOperationException))); } } @@ -346,7 +345,7 @@ namespace Spring.Aspects.Exceptions } catch (Exception e) { - Assert.IsInstanceOfType(typeof(InvalidOperationException), e); + Assert.That(e, Is.InstanceOf(typeof(InvalidOperationException))); } } @@ -369,7 +368,7 @@ namespace Spring.Aspects.Exceptions } catch (Exception e) { - Assert.IsInstanceOfType(typeof(InvalidOperationException), e); + Assert.That(e, Is.InstanceOf(typeof(InvalidOperationException))); } } @@ -445,7 +444,7 @@ namespace Spring.Aspects.Exceptions } catch (Exception e) { - Assert.IsInstanceOfType(typeof(InvalidOperationException), e); + Assert.That(e, Is.InstanceOf(typeof(InvalidOperationException))); } diff --git a/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2008.csproj b/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2008.csproj index 970bb77a..63bc9817 100644 --- a/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2008.csproj +++ b/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2008.csproj @@ -1,7 +1,7 @@  Local - 9.0.30729 + 9.0.21022 2.0 {2111596A-0327-4C9D-8919-294FBD988A23} Debug @@ -45,6 +45,7 @@ full prompt false + 0612 ..\..\..\build\VS.Net.2008\Spring.Aop.Tests\Release\ diff --git a/test/Spring/Spring.Core.Tests/Context/Support/AbstractMessageSourceTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/AbstractMessageSourceTests.cs index ee2dced7..72e2fe65 100644 --- a/test/Spring/Spring.Core.Tests/Context/Support/AbstractMessageSourceTests.cs +++ b/test/Spring/Spring.Core.Tests/Context/Support/AbstractMessageSourceTests.cs @@ -23,6 +23,7 @@ using System; using System.Globalization; using NUnit.Framework; +using Rhino.Mocks; #endregion @@ -31,9 +32,11 @@ namespace Spring.Context.Support [TestFixture] public sealed class AbstractMessageSourceTests : AbstractMessageSource { + private MockRepository mocks; [SetUp] public void Init() { + mocks = new MockRepository(); resetMe(); } diff --git a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2008.csproj b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2008.csproj index 0d8f3925..f5c39f7f 100644 --- a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2008.csproj +++ b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.2008.csproj @@ -1,7 +1,7 @@  Local - 9.0.30729 + 9.0.21022 2.0 {44B16BAA-6DF8-447C-9D7F-3AD3D854D904} Debug @@ -78,7 +78,7 @@ False ..\..\..\lib\Net\2.0\Common.Logging.dll - + False ..\..\..\lib\Net\2.0\DotNetMock.dll diff --git a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config index 02a7287f..a7cd6a6d 100644 --- a/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config +++ b/test/Spring/Spring.Core.Tests/Spring.Core.Tests.dll.config @@ -222,6 +222,7 @@ limitations under the License. + diff --git a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/TemplateTests.cs b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/TemplateTests.cs index fda8bfa0..330ae007 100644 --- a/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/TemplateTests.cs +++ b/test/Spring/Spring.Data.NHibernate.Integration.Tests/Data/NHibernate/TemplateTests.cs @@ -121,8 +121,7 @@ namespace Spring.Data.NHibernate IAdoExceptionTranslator translator = template.AdoExceptionTranslator; Assert.IsNotNull(translator, "ADO.NET exception translator should not be null"); - - Assert.IsInstanceOfType(typeof(ErrorCodeExceptionTranslator), translator); + Assert.That(translator, Is.InstanceOf(typeof(ErrorCodeExceptionTranslator))); } [Test] diff --git a/test/Spring/Spring.Data.Tests/Spring.Data.Tests.2008.csproj b/test/Spring/Spring.Data.Tests/Spring.Data.Tests.2008.csproj index c329294c..6a0a3141 100644 --- a/test/Spring/Spring.Data.Tests/Spring.Data.Tests.2008.csproj +++ b/test/Spring/Spring.Data.Tests/Spring.Data.Tests.2008.csproj @@ -1,7 +1,7 @@  Local - 9.0.30729 + 9.0.21022 2.0 {ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0} Debug @@ -73,7 +73,7 @@ False ..\..\..\lib\Net\2.0\Common.Logging.dll - + False ..\..\..\lib\Net\2.0\DotNetMock.dll diff --git a/test/Spring/Spring.Messaging.Nms.Tests/Spring.Messaging.Nms.Tests.2008.csproj b/test/Spring/Spring.Messaging.Nms.Tests/Spring.Messaging.Nms.Tests.2008.csproj index aabc194f..de3e880f 100644 --- a/test/Spring/Spring.Messaging.Nms.Tests/Spring.Messaging.Nms.Tests.2008.csproj +++ b/test/Spring/Spring.Messaging.Nms.Tests/Spring.Messaging.Nms.Tests.2008.csproj @@ -46,10 +46,6 @@ False ..\..\..\lib\Net\2.0\Common.Logging.dll - - False - ..\..\..\lib\Net\2.0\log4net.dll - False ..\..\..\lib\net\2.0\nunit.framework.dll diff --git a/test/Spring/Spring.Messaging.Tests/Spring.Messaging.Tests.2008.csproj b/test/Spring/Spring.Messaging.Tests/Spring.Messaging.Tests.2008.csproj index 3312e1c1..57a136d7 100644 --- a/test/Spring/Spring.Messaging.Tests/Spring.Messaging.Tests.2008.csproj +++ b/test/Spring/Spring.Messaging.Tests/Spring.Messaging.Tests.2008.csproj @@ -2,7 +2,7 @@ Debug AnyCPU - 9.0.30729 + 9.0.21022 2.0 {41BC3AEA-7EB3-48BF-B1EC-84119376AC98} Library @@ -33,10 +33,6 @@ False ..\..\..\lib\Net\2.0\Common.Logging.dll - - False - ..\..\..\lib\Net\2.0\log4net.dll - False ..\..\..\lib\Net\2.0\nunit.framework.dll