1

私はいくつかのspecflowテストを書きました。これらのテストを実行するには、App.config でいくつかの部分を構成する必要があります。ビジュアル スタジオでテスト ランナーとして resharper を使用してテストを実行すると、完全に正常に動作しますが、NUnit テスト ランナーでテストを実行すると、App.config が読み取られず、それに依存するすべてのテストが失敗するようです (私の場合はすべてのテスト)。

NUnit テスト ランナーに .dll 用に指定された app.config を読み取らせることは可能ですか?

更新: NUnit の 2.5.10 バージョンを使用しています。

私の app.config ファイル:

<?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>
4

0 に答える 0