views:

401

answers:

1

I'm getting started with WatiN to test my web interface. The problem I'm having is the following: When I start the tests from within TestDriven.net, I have no problem. If I use the ReSharper test runner, I get this predictable AppartmentState exception.

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

Any suggestions?

+4  A: 

I've use Resharper test runner in most of my watin test projects. To get it to work use the same method as for 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>
Edward Wilde
This doesn't work for me. I can tell that nUnit/Resharper is seeing the .config file because its pulling some custom values from the appSettings section correctly. It just doesn't seem to see the ApartmentState or set it correctly for the runner.
Hellfire
@Hellfire-it works for my Resharper runner.
Kai Wang

related questions