app.config in nunit test for acceptance testing

I have written some specflow tests. To get those test to run I need to configure some parts in App.config. Running the test with resharper as test runner in visual studio it works perfectly fine, but when running the test with the NUnit test runner it seems like the App.config is not read and all tests that depends on it fails (in my case that is every test).

Is there possible to get the NUnit test runner to read the app.config specified for a .dll?

UPDATE: I'm using the 2.5.10 version of NUnit.

My app.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityMappingsConfiguration" type="OPF.KP.Business.EntitySettings, OPF.KP.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
  </configSections>
  <entityMappingsConfiguration>
    <entityMappings>
      <entityMapping entityShortTypeName="ValidationResult" entityFactoryFullTypeName="OPF.KP.Business.Tests.ValidationResultStubFactory, OPF.KP.Business.Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      <entityMapping entityShortTypeName="Stillingsmelding" entityFactoryFullTypeName="OPF.KP.Business.FitNesseTests.StillingsmeldingFitNesseStubFactory, OPF.KP.Business.FitNesseTests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      <entityMapping entityShortTypeName="Stillingsmeldingsfelter" entityFactoryFullTypeName="OPF.KP.Business.StillingsmeldingsfelterFactory, OPF.KP.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
      <entityMapping entityShortTypeName="IInputModeSettings" entityFactoryFullTypeName="OPF.KP.Business.Tests.SettingsStubFactory, OPF.KP.Business.Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    </entityMappings>
  </entityMappingsConfiguration>
  <appSettings>
    <add key="ShouldExecuteHistoricValidation" value="true" />
    <add key="Kontrollstasjon.ValidatorService.Validate.ExecuteNoEnhetDuplicationVerification" value="false" />
  </appSettings>
  <specFlow>
    <language feature="no" />
  </specFlow>
</configuration>
链接地址: http://www.djcxy.com/p/51770.html

上一篇: 单元测试运行器

下一篇: app.config在nunit测试中进行验收测试