Hi,
We have some 120+ test. They usually start with in the BeforeEach method, which is annotated with [SetUp]
_controller = new WhateverController();
TestControllerBuilder builder = new TestControllerBuilder();
builder.InitializeController(_controller);
after test numer 112 it throws the following error on whichever method finds itself to be 113. We are using NUnit 2.5.3
Test 'Tests.Unit.Controllers.Areas.OnBoarding.CandidateController_Tests.GET_Create_Binds_SelectListItems' failed: System.InvalidOperationException : Use Arg<T> ONLY within a mock method call while recording. 0 arguments expected, 1 have been defined.
at Rhino.Mocks.ArgManager.CheckMethodSignature(MethodInfo method)
at Rhino.Mocks.Impl.RecordMockState.BuildParamExpectation(IInvocation invocation, MethodInfo method)
at Rhino.Mocks.Impl.RecordMockState.MethodCall(IInvocation invocation, MethodInfo method, Object[] args)
at Rhino.Mocks.MockRepository.MethodCall(IInvocation invocation, Object proxy, MethodInfo method, Object[] args)
at Rhino.Mocks.Impl.RhinoInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at HttpContextBaseProxyffe087d8ba564f10bc50e4070acb37f2.get_Session()
at lambda_method(Closure , HttpContextBase )
at MvcContrib.TestHelper.MockFactories.RhinoMocksProxy`1.SetupMockBehavior[TResult](Expression`1 expression, String behaviorName, Object[] behaviorArguments)
at MvcContrib.TestHelper.MockFactories.RhinoMocksProxy`1.ReturnFor[TResult](Expression`1 expression, TResult result)
at MvcContrib.TestHelper.TestControllerBuilder.Setup(IMockFactory factory)
at MvcContrib.TestHelper.TestControllerBuilder..ctor(IMockFactory mockFactory)
at MvcContrib.TestHelper.TestControllerBuilder..ctor()
Unit\Controllers\Areas\OnBoarding\CandidateController_Tests.cs(38,0): at Tests.Unit.Controllers.Areas.OnBoarding.CandidateController_Tests.BeforeEach()
Is there some sort of cleanup I should be doing ?