Settings in external file


You can define in the config file the xml attribute settings to express that the settings are defined in an external file and not in the test-suite. The value of this xml attribute settings matches with the name of the external file containing your xml fragment with the settings element of your test-suite.

It could be useful to develop several configs and settings file to manage different environments where you’re executing your tests.

In the example, here under, the settings are defined in an external file named “MySettings.nbiset”.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="nbi" type="NBi.NUnit.Runtime.NBiSection, NBi.NUnit.Runtime"/>
  </configSections>
  <nbi
    testSuite=" MyFirstTestSuite\MyFirstTestSuite.nbits"
    settings=" MyFirstTestSuite\MySettings.nbiset"
  />
</configuration>

This file is an example of an external file containing the xml element settings.

<?xml version="1.0" encoding="utf-8"?>
<settings>
  <default apply-to="system-under-test">
    <connectionString>My Sut Default Connection String</connectionString>
  </default>
  <reference name="MyReference">
    <connectionString>My Reference Connection String</connectionString>
  </reference>
</settings>