This project is read-only.

constructors not called?

Topics: ReSharper test runner
Jun 27, 2009 at 6:25 PM

Folks,

Apologies if I'm totally missing this, but my constructors don't seem to be called when using Resharper runner for xUnit tests.  Is this expected behavior?

Jul 1, 2009 at 12:29 AM

Nope, it's not expected behaviour, unless your test methods are static. Then, the constructor doesn't get called because the test doesn't need an instance of the class.

The only other thing I can think of is that you have more than one constructor, and only the default constructor gets called?

Hope this helps
Matt

Jul 1, 2009 at 12:38 AM

Matt,

I'm embarrassed I ever asked this question.  My methods were static so of course the constructor would never be called.  Sorry for the trouble.

-Suraj