This is a migrated thread and some comments may be shown as answers.
JustMock on TFS Build 2010
3 Answers 78 Views
This is a migrated thread and some comments may be shown as answers.
Alexey Kobin
Top achievements
Rank 1
Alexey Kobin asked on 11 Dec 2012, 11:15 AM

Hi. I try to run simple test with JustMock on build machine:

Mock.SetupStatic(typeof(ConsoleApplication1.MyClass));

Mock.Arrange(() => ConsoleApplication1.MyClass.GetNumber()).Returns(777);

Assert.AreEqual(777, ConsoleApplication1.MyClass.GetNumber());

The test failed with message:

«Telerik.JustMock.MockException: Profiler must be enabled to mock/assert target MyClass.GetNumber() method.»

Error Stack Trace:

Telerik.JustMock.Handlers.InterceptorHandler.Create(Object target, MethodInfo methodInfo, Boolean privateMethod)

Telerik.JustMock.MockContext`1.SetupMock(MockExpression`1 expression)

Telerik.JustMock.Mock.<>c__DisplayClass1`1.<Arrange>b__0(MockContext`1 x)

Telerik.JustMock.MockContext.Setup[TDelgate,TReturn](Instruction instruction, Func`2 function)

Telerik.JustMock.Mock.Arrange[TResult](Expression`1 expression)

JustMockTestProject1.JustMockTest1.TestMethod1()

Messages from Event Viewer:

.NET Runtime version 4.0.30319.261 - The profiler was loaded successfully.  Profiler CLSID: '{B7ABE522-A68F-44F2-925B-81E7488E9EC0}'.  Process ID (decimal): 1044.  Message ID: [0x2507].

.NET Runtime version 4.0.30319.261 - Loading profiler failed during CoCreateInstance.  Profiler CLSID: '{D1087F67-BEE8-4f53-B27A-4E01F64F3DA8}'.  HRESULT: 0x80070002.  Process ID (decimal): 3028.  Message ID: [0x2504].

My build environment:

Windows Server 2008 R2 Standard Service Pack 1

Team Foundation Server - Standard Edition

JustMock Version Q3 2012 (2012.3.1016.3)

To solve this problem I was trying:

Followed this instruction from  next link: http://www.telerik.com/help/justmock/integration-code-activity-workflow.html.

But I couldn’t drop JustMockTestRunner activity to build template.

Then I added the text shown below to test project

<Import Project="C:\Program Files (x86)\Telerik\JustMock\Libraries\JustMock.targets" />

  <Target Name="BeforeTest">

    <JustMockStart />

  </Target>

  <Target Name="AfterTest">

    <JustMockStop />

  </Target>

Also I tried to modify workflow template in the way the next post adwises http://www.telerik.com/community/forums/justmock/general-discussions/setupstatic---mockexception-opps-there-were-some-error-intercepting-target-call.aspx#1259708

Also tried this http://www.telerik.com/community/forums/justmock/general-discussions/use-justmock-in-msbuild.aspx#2309253 and this http://www.telerik.com/community/forums/justmock/general-discussions/profiler-must-be-enabled-error.aspx#2254776

So I don’t know what else I can do to run tests on the build environment.

Could you advise some decision?

Best regards,

Eugene Ozerov

3 Answers, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 13 Dec 2012, 04:43 PM
Hi Alexey,
Thanks again for contacting us. An answer to this issue is sent in Ticket# 639979. Please check it out.

Kind Regards
Mehfuz
the Telerik team
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
0
Ross
Top achievements
Rank 2
answered on 02 Dec 2013, 10:58 PM
HI Telerik Team

Sorry to dig up an old thread but I am not sure how to get to Ticket# 639979, when I do a search it only brings up this page again. Any help would be appreciated

Cheers
Ross
0
Stefan
Telerik team
answered on 03 Dec 2013, 01:39 PM
Hi Ross,

The ticket mentioned is a private support ticket.

Are you experiencing issues integrating JustMock in a TFS 2010 build? If so, please open a new support case with us and we will be happy to help you out!

Regards,
Stefan
Telerik
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.
Asked by
Alexey Kobin
Top achievements
Rank 1
Answers by
Ricky
Telerik team
Ross
Top achievements
Rank 2
Stefan
Telerik team
Share this question
or