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
Hello,
I have installed TypeMock 4.1.0 version.In the examples given with the product(C# 2.0),all the test cases are failing while testing with the NUnit 2.4 .
while debugging the individual test cases we not getting proper results what mentioned in the comments of given code.
we are new to TypeMock, so its very diffcult for us to implement in our code as the sample examples are not working properly.
so please help us out with this. its urgent.
asked by yogesh.agrawal (640 points)

3 Answers

0 votes
Hi,

First I would like to welcome you to our users group.

Can you post the exact error that you're getting?
Its really hard knowing what is wrong without it.

If you are getting multiple compilation errors on NUnit
classes. Just remove the reference to nunit from the example project and add it again.
Sometime NUnit can not be found by the in its default location and all references in the examples need to be fixed.

Hope this helps
answered by lior (13.2k points)
0 votes
Hello Lior,
thanks for immediate response.
What you mentioned that I already done, there are no any compilation error.but when I run the NUnit GUI, it shows all the test cases included in this example project are failing. I am getting error:

Examples.Tests.NaturalMocks.Test1_Basic.MockTheFactoryAlways : 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)


I tried to follow the steps mentioned above, i run the bat file, but i am not able to run TMockRunner.exe. I am not understanding the step 2 and 3.
I tried to add the code mentioned in help files, to the MSBuild file of project, but its not working. I have tried to add following snippets:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <TypeMockLocation>C:Program FilesTypeMockTypemock Isolator</TypeMockLocation> <NUnit>"C:Program FilesNUnitin unit-console.exe"</NUnit> </PropertyGroup> <Import Project ="$(TypeMockLocation)TypeMock.MSBuild.Tasks"/>
<Target Name="TestWithTypeMock">
<TypeMockStart/> <Exec ContinueOnError="true" Command="$(NUnit) Test.dll"/> <TypeMockStop/> </Target></Project>



In visual studio, its already showing typemock enabled.
answered by yogesh.agrawal (640 points)
0 votes
You might have the wrong path to TypeMockLocation. If memory serves, they didn't rename Typemock to Typemock Isolator until the 4.2.x series, and if you installed 4.1.0, the path is going to be slightly different than what you posted. Something like "C:Program FilesTypeMockTypeMock.NET" I think.

I've got a blog post with a little more robust information on integrating NUnit, NCover and Typemock in a build. That might help you out.

http://www.paraesthesia.com/archive/200 ... build.aspx
answered by tillig (6.7k points)
...