Unit Tests Failing In MsBuild on TFS 2012

4 posts, 1 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 03 Jun 2015 Link to this post

    Like the user in this thread I'm having a problem getting my unit tests running in TFS. In my case, I'm running TFS 2012. However, having read through the thread I assumed that the process to fix it would be the same.

    A little more reading and I found this documentation article and I followed the steps shown there. In my case I followed the "Steps for integrating JustMock in updated build configurations (DefaultTemplate.11.1.xaml)".

    I set up the Build Controller to get the required assemblies (jm01.png)

    I modified the build template (jm02.png)

    After checking in the modified template I ran my build. It failed.

    "Test method Genesis.Service.Implementation.Tests.Digests.WeeklyDigestFixture.ShouldCallAllSections threw exception: 
    Telerik.JustMock.Core.ElevatedMockingException: Cannot mock 'Int32 get_DigestsToBeIncludedOn()'. The profiler must be enabled to mock, arrange or execute the specified target.
    "

     Thinking I must have missed a step and that the profiler wasn't working I investigated further.

    jm03.png and jm04.png, however, suggest that I didn't.

    So why are my tests failing?

  2. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 03 Jun 2015 in reply to Stuart Hemming Link to this post

    Just FYI, I have just upgraded both JustMock and the workflow DLLs to version 2015.2.512.4 and got the same result.
  3. DevCraft R3 2016 release webinar banner
  4. Answer
    Stefan
    Admin
    Stefan avatar
    198 posts

    Posted 04 Jun 2015 Link to this post

    Hi Stuart,

    Do you have JustMock installed on the build agent executing the build?

    Regards,
    Stefan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 05 Jun 2015 in reply to Stefan Link to this post

    Initially, I had just the JustMock.dll on the build server and just one test was failing; the only test using JustMock.

    Following your post I've installed the full product on the Build Server and the issue is resolved.

    Thx

Back to Top