RajOpteamix / moq

Automatically exported from code.google.com/p/moq
Other
0 stars 0 forks source link

Debugging with Moq is cripplingly slow to start when mocking IHTML* interfaces that return mocked objects #228

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use this test, it fails with various combinations of IHTML* interfaces:

[Test]
public void SlowMoqTest()
{
  var element = new Mock<IHTMLElement>();
  var st = element.As<IHTMLStyle>();
  element.SetupGet(s => s.style).Returns((IHTMLStyle)element.Object);
}

2. Run the test with the debugger.
3. Wait 5 minutes or so for the code to run.

What is the expected output? What do you see instead?
It runs fine when running the unit test without the debugger, but for some 
reason, attaching the debugger is slow. I've attached a screen shot of the 
call stack where the hang seems to appear. I cannot tell if it is a Moq 
problem, a DynamicProxy problem, or Microsoft problem.

What version of the product are you using? On what operating system?
It occurs under Moq 3.0, and Moq's mainline trunk.

Please provide any additional information below.

Original issue reported on code.google.com by skygu...@gmail.com on 1 Feb 2010 at 7:54

Attachments:

GoogleCodeExporter commented 8 years ago
This isn't a good test, I forgot about my fixture SetUp routines when I posted 
this . 
I'll provide an updated example that is really, really slow.

Original comment by skygu...@gmail.com on 1 Feb 2010 at 8:27