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
This information form your documentation regarding mocking-on.bat. seems to do nothing.

"Run mocking-on.bat from the installation directory.
run your tests
run mocking-off.bat"



I can run my test with TMockRunner, but I'm wondering what mocking-on.bat does and how I am supposed to use it.

What I do is run mocking-on.bat
Then open nunit and run my tests.

I get the error
MockInserter not running, please run 'mocking_on.bat' before running the tests
asked by jnapier (9.6k points)

3 Answers

0 votes
What I do is run mocking-on.bat
Then open nunit and run my tests.

I get the error
MockInserter not running, please run 'mocking_on.bat' before running the tests


Hi,
After typing mocking_on.bat in the same console write: nunit-gui.exe <dll>,
it should work.

BTW. What version are you using?
Are you using the Visual Studio addin?
answered by scott (32k points)
0 votes
I'm using version 2.2.

Generally I use the Visual Studio add in, but one of my devs was wanting to run the test directly from Nunit without launching Nunit from Vs.Net while in debug mode, so we were trying to figure mocking-on.bat out and couldn't get it to do anything.

TMockRunner works fine, so if you pretty much to do the same thing with mocking-on from the command line then whats the difference between the two and when should you use one over the other?
answered by jnapier (9.6k points)
0 votes
Hi,
There is actually no real difference.
To run TypeMock, two environment variable have to be defined BEFORE running the executable. These are in mocking_on.bat (This turns on the CLR- Profiler).

so after running mocking_on.bat , Restart the application that should be mocked.

TMockRunner, runs the application with the environment variables already defined.
answered by scott (32k points)
...