This is a migrated thread and some comments may be shown as answers.

Profiling a Test which uses JustMock

3 Answers 214 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 25 Jul 2014, 03:16 PM
I'm using Visual Studio 2013. 

I've configured JustMock to "run together with JustMock" all detected profilers, however I'm seeing this exception:

Test Name: IndexPageTest
Test FullName: XXXXXXX.XXXX.Tests.Transport.TransportControllerTests.IndexPageTest
Test Source: c:\XXXXXXXXXXX\XXXXXweb\User Interface\Tests\Transport\TransportControllerTests.cs : line 24
Test Outcome: Failed
Test Duration: 0:00:00

Result Message: Unable to create instance of class XXXXXXX.XXXX.Tests.Transport.TransportControllerTests. 
Error: Telerik.JustMock.Core.ElevatedMockingException: Cannot mock 'XXXXXXX.XXXX.Web.Application.Core.Providers.UserProfileProvider'. 
The profiler must be enabled to mock, arrange or execute the specified target.
Detected active third-party profilers:
* {B61B010D-1035-48A9-9833-32C2A2CDC294} (from process environment)
Disable the profilers or link them from the JustMock configuration utility. Restart Visual Studio and/or the test runner after linking..
Result StackTrace:
at Telerik.JustMock.Core.ProfilerInterceptor.ThrowElevatedMockingException(MemberInfo member)
   at Telerik.JustMock.Core.MocksRepository.InterceptStatics(Type type, IEnumerable`1 mixins, IEnumerable`1 supplementaryBehaviors, IEnumerable`1 fallbackBehaviors, Boolean mockStaticConstructor)
   at Telerik.JustMock.MockBuilder.InterceptStatics(MocksRepository repository, Type type, Nullable`1 behavior, Boolean mockStaticConstructor)
   at Telerik.JustMock.Mock.<>c__DisplayClass67.<SetupStatic>b__66()
   at Telerik.JustMock.Core.ProfilerInterceptor.GuardInternal(Action guardedAction)
   at Telerik.JustMock.Mock.SetupStatic(Type staticType, StaticConstructor staticConstructor)
   at XXXXXXX.XXXX.Tests.Common.ControllerTestBase..ctor() in c:\XXXXXXXXXXX\XXXXXweb\User Interface\Tests\Patient\TransportTest.cs:line 75
   at XXXXXXX.XXXX.Tests.Transport.TransportControllerTests..ctor()


Help!

Thanks in advance,
-bill 

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 28 Jul 2014, 03:21 PM
Hi Bill,

It appears you're trying to profile your unit test run using the Visual Studio 2013 Performance Profiler. JustMock is not yet integrated with it. Try running the tests regularly without starting a profiling session.

If you need to profile your tests using VS2013, please inform me, so that I can give this story a priority boost.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Bill
Top achievements
Rank 1
answered on 29 Jul 2014, 08:40 PM
The reason for trying to profile the test, was to see why the unit test was taking 20+ minutes when I mocked HttpContext, see another thread in this forum.

thanks for your help.

-bill
0
Accepted
Stefan
Telerik team
answered on 31 Jul 2014, 08:16 AM
Hi Bill,

If you wish to profile the unit tests I recommend that you use JustTrace. Follow the steps described here to get started.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Bill
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Bill
Top achievements
Rank 1
Share this question
or