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'm receiving the following error message in the NUnit GUI Error and Failures tab when attempting to set a break point in the Test1_Basic.MockTheFactoryStaticMethod. I've set the MS Visual Studio Tools->Enable typeMock.NET, then brought up the NUnit GUI, then attached to the NUnit process.

Examples.Tests.Test1_Basic.MockTheFactoryStaticMethod : TypeMock.TypeMockException :
*** TypeMock.NET is not enabled, to enable do one of the following:
1. run 'mocking_on.bat' before running the tests
2. run tests via TMockRunner.exe
3. use TypeMockStart tasks for MSBuild or NAnt
4. set Tools->Enable TypeMock.NET from within Visual Studio
For more information consult the documentation (see Running topic)
asked by

1 Answer

0 votes
Hi Dave

There are three possible solutions to your problem:

1. Run mocking_on.bat from TypeMock installation directory *before* running nunit. (Just like the error message suggests)

2. an even better way to run your tests is to run them from within the Visual Studio (this is what the addin is for):
Open the solution properties --> debug tab.
Check the radio button near "Start external program" and write the
full path to nunit-console.exe. e.g ("C:\Program Files\NUnit-Net-2.0
2.2.8\bin\nunit-console.exe")
Under Command line arguments write the full path to the dll you are
trying to debug.
Now you can debug your tests by Right click the solution in the solution browser. Go to debug --> start new instance.

3. The best simple solution: Download and install TestDriven.NET from
http://www.testdriven.net
This will allow you to set break point in the source file and start
debug session by right click on the source and choose Test with -->Debugger

Hope it helps
answered by ohad (35.5k points)
...