Tests in Visual Studio not running when using CreateController method of TestControllerBuilder

102 views Asked by At

I am trying to user mvccontrib test helper and rhino mocks to test mvc controller. But my test doesnt load.First two lines of the test are given below

TestControllerBuilder builder = new TestControllerBuilder(); var custCtrl = builder.CreateController<CustController>();

I am new to rhino mock and mvc contrib.

1

There are 1 answers

0
Shaiju Janardhanan On

Just found the help here kevinlabranche.com

The fix is a binding direct.

Add an app.config to your test project and paste in the following:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="4.0.0.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>