Running WatiN Tests with ReSharper testrunner

I am starting to work with WatiN to test my web interface. The problem I am facing is this: When I run the tests from TestDriven.net, I have no problem. If I use the ReSharper test run, I get this predictable AppartmentState exception.

I tried using the various parameters described here: http://watin.sourceforge.net/apartmentstateinfo.html#testdriven . Nothing helps.

Any suggestions?

+3
source share
3 answers

- Resharper watin. , , nunit:

http://watin.sourceforge.net/apartmentstateinfo.html#nunit

App.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="NUnit">
      <section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
    </sectionGroup>
  </configSections>
  <NUnit>
    <TestRunner>
      <!-- Valid values are STA,MTA. Others ignored. -->
      <add key="ApartmentState" value="STA" />
    </TestRunner>
  </NUnit>
</configuration>
+4

NUnit 2.5 RequiresSTA .

+1

Resharper 5.1 VisualStudio 2010 Ultimate, , Resharper, " Shadow-Copy" ( Resharper → Options → Tools → Unit Testing). , , - , dll (: assemblyname.dll.config).

0

Source: https://habr.com/ru/post/1711746/


All Articles