Hi, I am new to TypeMock and there is an issue that I can't seem to resolve. I'm unable to mock any of the .NET framework types, even the ones that aren't in mscorlib. The following code demonstrates the issue:
[TestMethod]
public void MyTestMethod()
{
MockManager.Init();
Mock<System.Net.Sockets.TcpClient> mock = MockManager.MockAll<System.Net.Sockets.TcpClient>();
mock.ExpectConstructor(1);
System.Net.Sockets.TcpClient foo = new System.Net.Sockets.TcpClient();
MockManager.Verify();
}
The result is a VerifyException... "Method System.Net.Sockets.TcpClient..ctor() has 1 more expected calls." I have tried it with both Mock and MockAll. I have also tried it with a few other framework types, and with methods instead of constructors. Nothing seems to work. If I mock a simple type that I create (one that's not in the .NET framework), then everything works as expected.
Some more info... I'm using Visual Studio 2008, targeting either .NET 2.0 or 3.5. I'm running the tests using the built-in test runner.
I'd appreciate any help you can provide.
Thanks,
Jack