Running JustMock profiler outside of Visual Studio

In this post , I would be focusing on the issue that generally comes to query on how to run JustMock with standalone tools like nunit or msbuild console. Since mocking concrete method works initializing the .net profiler that is set using two variables in the runtime to let JustMock work the correct way.

COR_ENABLE_PROFILING, “0x1”
COR_PROFILER, "{B7ABE522-A68F-44F2-925B-81E7488E9EC0}"

Now while running msbuild  or nunit console or standalone GUI tool, initialization is not always the easy / expected thing to get going.  Therefore I created a tiny runner (unofficial) that will do just that and let you pipe your test DLL containing the tests  with JustMock. All you have to do is create a batch file where you will pass the path to runner and test DLL in the following format:

JustMockRunner.exe  "%Path to test runner%\nunit-console.exe”  "%PathToDir%\JustMockTrialTests.dll"

 

Once the bat is executed, in this case it will open up the console, run the tests and print result from the test runner.

image

 

The runner along with a sample project (taken from a user’s post in JustMock forum) can be downloaded by clicking the link below:

JustRunner_with_samples.zip
 
Update: JustMockRunner.exe is now shipped with the product installer and can be found under %ProgramFiles%/Telerik/JustMock/Libraries folder.
 

P.S. To take the advantage of profiler intensive tests , JustMock full edition  must be installed which actually registers the profiler. Also, please build the test project (output DLLs are removed) before running  Run.bat .

 

Hope this helps

Update : JustMockRunner.exe to work in .net 3.5 and removed the extra Console.ReadLine that was causing problem in CI server integration.

No Comments