chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes

The foillowing test is successful when I run it with Visual Studio Testrunner but fails when I run it with SmartRunner even if I do not mocking at all. I just use the TypeMock Testrunner. That's all.

[TestMethod]
[TestCategory("IntegrationTest")]
public void ATest()
{
  // I know that is not a test that makes any sense. It's just some code 
  // to illustrate the issue that I have with SmartRunner.

  using (new Impersonator(new NetworkCredential("username", "password", "domain.local")))
  {
    using (DirectoryEntry de = new DirectoryEntry("LDAP://domain.local"))
    {
      SearchResult adSearchResult = null;
      using (DirectorySearcher adSearch = new DirectorySearcher(de))
      {
        adSearch.Filter = string.Format("(sAMAccountName={0})", "MockTestUser");
        adSearchResult = adSearch.FindOne();
      }
    }
  }
}

The Impersonator is using native method LogonUser from advapi32.dll to perform the impersonation.

Result with VS Testrunner: 

 

Result with SmartRunner:

So question is why does this "test" fail when i use it with SmartRunner. Is there something I can do to get it running?

asked by (640 points)

1 Answer

0 votes
Hi,

Thank you for the repro.

We're looking into and will update you.
answered by (18k points)
...