lundi 4 mai 2015

Using vstest.consol.exe to run Moq unit tests

I have used Moq in my unit tests in Visual Studio 2013. I need to run the test cases in Command-line using "vstest.console.exe".

When trying to do so, I get this error:

Error: An exception occurred while invoking executor 'executor://mstestadapter/v1': Could not load file or assembly 'Codex.Repository, verion=1.0.0.0, Clture-neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

This is the command I use to run tests:

vstest.console.exe "C:.../Codex.repository.unittests.dll" /UseVsixVersion /Framework:framework45

When trying to execute the test cases individualy using "/Tests:" tag, I got a more detailed error message:

Could not load file or assembly 'Moq, Version=4.2.1502.911, Culture-neutral, PublicKeyToken=69f4...' or one of its dependencies. The system cannot fild the file specified.WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: there is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

So now I know the reason is using Moq in my test cases.

How can I solve this problem?

Aucun commentaire:

Enregistrer un commentaire