How to install Moq framework
This is an old question, but the convenient method I used is not listed here and this is the first result on google. I am using VS 2013 and if I search for Moq in Extensions and Updates there are no results so:
- Go to Package Manager Console - (Tools -> Library Package Manager)
- Change the default project to your test project
- Then type:
install-package moq
The best way to add reference to Moq framework is installing it from Nuget. Also you still can download Moq.dll and add reference to this library (usually I create folder libs
under the solution folder, where I put all third-party libraries, which is not available via Nuget).
BTW Another option to install package from Nuget - right click on project references and select Manage Nuget packages...
. Then search online for Moq and install it. See why use Nuget over installing libraries directly on my machine
There's no need to install it. Just add a reference to the moq.dll in your project.
But of course you can use gacutil
to register the library in your global assembly cache.
c:\path> gacutil /i Moq.dll
When using Visual Studio:
- Right click on References [It's in the project Explorer]
- Manage NuGet Packages
- Search for Moq and add it to your solution.