Came across this today while working through the NerdDinner example in the first chapter of the new MVC book from Wrox. This chapter is available free from Scott Gu’s Blog. Have to say it’s an excellent introduction to Microsoft’s MVC and luckily the book, which I’ve had on back-order has finally shipped to me today so there’ll be no hold-up going through the rest of it!
Anyway, coming back to the problem, the chapter talks briefly about mocking frameworks and suggests using moq in the tutorial. Download it, unzip it and reference it in the project – fine. Then when you run the unit tests ….. they don’t, run that is. MOQ.DLL is not trusted so the tests won’t execute.
Fortunately it’s a very easy fix, locate the dll in your source directory, right click and select Properties. You should see something like this :
Look at the bottom at the Security information. Unblock the dll and apply the changes. You should then be able to continue with your tests.