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
Is a TypeMock.NET for .NET 2.0 in the works? I tried to use v2.2 with .NET 2.0. While I did not use generics, MbUnit.GUI.exe crashed every time (latest MbUnit cvs). It did not crash with .NET 1.1.

PS: Those environment variables are really annoying. Maybe a configuration file should be available that sets it to always on or always off. TMockRunner.exe does not work by itself. I always have to run the bat file, then TMockRunner.exe MbUnit.Gui.exe MyProject.mbunit.

For SharpDevelop, this seems to work:
var shell = WScript.CreateObject("WScript.Shell");
shell.Run(""C:\Program Files\TypeMock.NET\mocking_on.bat"", 0);
shell.Run(""C:\Program Files\TypeMock.NET\TMockRunner.exe" "C:\Program Files\SharpDevelop\bin\SharpDevelop.exe"", 0);

Unfortunetly, putting MbUnit in the Tools menu does not work.
Command: C:WINDOWSsystem32wscript.exe
Arguments: "C:Program FilesMbUnitMbUnit.js" (Same script as above with MbUnit instead of SharpDevelop.)

Is TMockRunner really needed? Isn't it possible to inject the code at comile time, or exactly after compile and the code to run without TMockRunner?

Thanks in advanced
asked by Dog_Soldier (3.1k points)

3 Answers

0 votes
Hi,
Here are some answers to your questions:

Is a TypeMock.NET for .NET 2.0 in the works? I tried to use v2.2 with .NET 2.0. While I did not use generics, MbUnit.GUI.exe crashed every time (latest MbUnit cvs). It did not crash with .NET 1.1.

:arrow: TypeMock.NET currently does not support .NET 2.0, We are currently working on supporting .NET 2.0, it will be available in one of the next releases.


PS: Those environment variables are really annoying. Maybe a configuration file should be available that sets it to always on or always off.

:arrow: It is true that the environment variables are annoying, but currently this is the only way to start TypeMock.NET. Using the Visual Studio Integration makes life much easier.

TMockRunner.exe does not work by itself. I always have to run the bat file, then TMockRunner.exe MbUnit.Gui.exe MyProject.mbunit.

:arrow: TMockRunner.exe should work on its own, actually running the bat and TMockRunner.exe doesn't really do anything.
:?: What happens if you run: TMockRunner.exe MbUnit.Gui.exe MyProject.mbunit?

For SharpDevelop, this seems to work...

:arrow: Thanks for telling us how to run TypeMock.NET in SharpDevelop. I am not sure about integrating TypeMock in SharpDevelop, I will install it and try it myself.
:?: How are you running your tests from within the IDE?

Is TMockRunner really needed? Isn't it possible to inject the code at comile time, or exactly after compile and the code to run without TMockRunner?

:arrow: This is a question that we asked ourselves before developing TypeMock, There are many reasons why injecting the code at runtime is better then at or after compiler time
:idea: Here is a short list:
1. No need for special compilation/post build events
2. Can mock libraries that have no source code available
3. Supports Strongly Signed Assemblies
4. Can test actuall library that will be deployed
5. No need to duplicate or copy libraries and switch library references in the IDE

Of course the price of this is
1. Setting environment variables before running.
This is solved with the bat file, TMockRunner.exe and IDE integration.
2. Code Coverage tools might clash with TypeMock as the use the same Inerface.
This is solved in the next release (Should be before the end of this month)

I hope that this helps
answered by richard (3.9k points)
0 votes
Hi Richard,

richard wrote:
Code Coverage tools might clash with TypeMock as the use the same Inerface.
This is solved in the next release (Should be before the end of this month)

Oh, that is good news.
By the way does this also mean we can use profilers together with TypeMock?

Bye,
Michael
answered by mknaup (8.5k points)
0 votes
By the way does this also mean we can use profilers together with TypeMock?

Yes, Although each tool must be defined.
What tool do you have in mind, and when do you think that you will be profiling the tests?
answered by richard (3.9k points)
...