chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
I get the above message when i try to run any test even though i did run the batch file before
asked by tolisss (28.8k points)

3 Answers

0 votes
I get the above message when i try to run any test even though i did run the batch file before


Hi,
The MockInserter must be set on before you run the tests (This turns TypeMock.NET on) . So if for example you are using the nunit-gui, you must first run mocking_on.bat and then nunit-gui.exe (in the same session). Running the gui and then run the batch file, won't work.

The other way to run the tests is by running the tests through TMockRunner, this is done by typing TMockRunner nunit-gui <assembly> on the same line, and this will assure that Mocking is enabled. (see Jump Start)

When running TypeMock tests using a Visual Studio add-in (TestDriven.NET for example) you have to run the Visual Studio after enabling mocking. This can be done by starting the Visual Studio Command line, running mocking_on.bat and then running devenv (see FAQ). We are currently working on a Visual Studio Addin that will enable turning on the mocking, from within the environment.

I hope that this clears things up, and that you are able to run your tests.
answered by richard (3.9k points)
0 votes
Hi im not using nunit i m trying to make your promising library work with TestDriven.Net addin could u please suggest how can i achieve it. I read at your site that the addin is supported but i couldn't manage to run any test yet
answered by tolisss (28.8k points)
0 votes
Hi,
It is quite simple, follow these steps.
1. Start the Visual Studio Command Line
2. In the command line screen run [TypeMock Installation]/mocking_on.bat
3. run devenv

By the way what unit testing framework are you using?
answered by richard (3.9k points)
...