5 Replies Last post: Sep 4, 2014 2:59 PM by Fedor Buyvol-Kot  
Sean Conway Newbie 3 posts since
Jun 25, 2014
Currently Being Moderated

Jun 25, 2014 8:58 PM

TestInitialize not being called for Windows Store Unit Test Project

I'm evaluating dotCover for a Windows Store Application and I'm trying to cover some unit tests for this using an MSTest unit test project (using VS2013). In my tests I'm using a Initialize method with the TestInitialize attribute to set up some stub classes. When I try to run the "Cover Unit Tests with dotCover" the tests always fail and when I check the coverage it shows the Initialize method in pink indicating it was never run, thus causing exceptions in my unit tests.

 

However when I just run the unit tests normally then the Initialize method does get called and all my tests pass. I also tried a console application with a unit test project and dotCover has no problem calling the TestInitialize method there. Is there some configuration setting I'm missing so that "Cover Unit" tests will succeed in Windows Store unit test projects?

Maria Serebryansky Newbie 29 posts since
May 15, 2014
Currently Being Moderated
Jun 26, 2014 1:12 PM in response to: Sean Conway
Re: TestInitialize not being called for Windows Store Unit Test Project

Hello Sean,

 

 

 

Do you work with dotCover test runner or with ReSharper test runner? You can check this here: ReSharper | Options | Tools | Unit Testing and dotCover | Options | Unit Testing.
Could you please send us a sample solution where this problem is present?

Kind regards,
Maria

Fedor Buyvol-Kot JetBrains 95 posts since
Dec 9, 2011
Currently Being Moderated
Jun 30, 2014 3:17 PM in response to: Sean Conway
Re: TestInitialize not being called for Windows Store Unit Test Project

Hi Sean,

 

The issue http://youtrack.jetbrains.com/issue/DCVR-6889 is already fixed and the fix will be included in the next release.

Current workaround is to disable "Collect per-test information for WinStore tests" in dotCover | Options | General.

 

Best Regards,

Fedor.

Fedor Buyvol-Kot JetBrains 95 posts since
Dec 9, 2011
Currently Being Moderated
Sep 4, 2014 2:59 PM in response to: Sean Conway
Re: TestInitialize not being called for Windows Store Unit Test Project

Hi Sean,

 

You are welcome to try recently released dotCover 2.7.2, it contains the necessary fix: http://www.jetbrains.com/dotcover/download/index.html

 

Best regards.

More Like This

  • Retrieving data ...