mardi 6 octobre 2015

Unable to debug unit test cases using fakes

I am using unit test project along with MS Fakes mocking framework within visual studio 2013 Visual Studio Premium 2013 Update 4. It works fine when I run my tests within visual studio, but when I try to debug unit tes cases it fails with below error:

Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: Failed to resolve profiler path from COR_PROFILER_PATH and COR_PROFILER environment variables.

Following methods i have tried:

1: Specific Version to false [Not worked] 2: Removed all fakes, clean, build and readded [Not worked] 3: Added System and mscorlib fakes [Not worked]

Edit:

[TestMethod]
public void LoginResponseTest()
{
    using (ShimsContext.Create())//Getting error here in case of debug test
    {

      var stub = new StubISimpleHttpService();
      stub.SendPostRequestStringParameterCollection = GetLoginResponse;
      MyAPIConnector connector = new MyAPIConnector();
      uint response = connector.login("test_username", "test_password");

      Assert.IsTrue(response == 0);                
    }    
}

Any solutions?

Aucun commentaire:

Enregistrer un commentaire