Unit Tests Failing In MsBuild on TFS 2010

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    9 posts
    Member since:
    Jun 2014

    Posted 13 Jan 2015 Link to this post


    I have unit tests that are working fine locally in Visual Studio 2013, but when the build runs on TFS and attempts to run the Unit Tests it fails with the following:

    Test method WingsServicesTests.Unit.LoanIntegrationServiceTests.AddressNeedsUpdating_GetSingleValueFromField threw exception:
    Telerik.JustMock.Core.ElevatedMockingException: Cannot mock 'Boolean IsHostUp()'. The profiler must be enabled to mock, arrange or execute the specified target

    I searched the forums and found referneces to this article: http://www.telerik.com/help/justmock/integration-msbuild-tasks.html

    I was not sure where the items referenced in that article should be placed, so I put them in all 3 project files in the solution, including the test project, but it still doesn't work.I have set both "Perform Code Analysis" and "Analyze Test Impact" to false in the build definition, thinking that those might be the problem if they try to do code coverage.Any help would be appreciated.


  2. Kaloyan
    Kaloyan avatar
    878 posts

    Posted 15 Jan 2015 Link to this post

    Hello Andrew,

    If you are using the TFS code activity workflow for configuring your build process, you will need to follow the steps in this article.

    If you are directly executing MS Build tasks in order to build your project and then run the tests, you will need to add the JustMockStart and JustMockStop tasks in your MSBuild targets.

    I hope this helps. Please, let me know if you need further assistance.


    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.

Back to Top