[Mono-bugs] [Bug 49363][Nor] New - nunit-console.exe doesn't load .config file of a nunit test suite
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Mon, 6 Oct 2003 05:38:36 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by carlosga@telefonica.net.
http://bugzilla.ximian.com/show_bug.cgi?id=49363
--- shadow/49363 2003-10-06 05:38:36.000000000 -0400
+++ shadow/49363.tmp.26583 2003-10-06 05:38:36.000000000 -0400
@@ -0,0 +1,128 @@
+Bug#: 49363
+Product: Mono/Runtime
+Version: unspecified
+OS:
+OS Details: Linux Red Hat 8
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: carlosga@telefonica.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: nunit-console.exe doesn't load .config file of a nunit test suite
+
+i have a nunit test suite that have some configuration params stored in
+a config file the
+parameters are accessed using ConfigurationSettings.AppSettings["xxx"]
+this works nice in windows/ms .net but in linux/mono seems that the config
+file is
+not loaded.
+
+
+Test case:
+
+NUnit Test fixture:
+
+using System;
+
+using System.Text;
+
+using System.Data;
+
+using System.Configuration;
+
+using NUnit.Framework;
+
+
+
+namespace NUnitTestSuite
+
+{
+ [TestFixture]
+
+ public class TestSuite
+
+ {
+
+ [SetUp]
+
+ public void SetUp()
+
+ {
+
+ // Build the connection string
+
+ StringBuilder connString = new StringBuilder();
+
+ connString.AppendFormat(
+
+ "User={0};Password={1};Database={2};DataSource={3};Port={4};SSL={5}",
+
+ ConfigurationSettings.AppSettings["User"],
+
+ ConfigurationSettings.AppSettings["Password"],
+
+ ConfigurationSettings.AppSettings["Database"],
+
+ ConfigurationSettings.AppSettings["DataSource"],
+
+ ConfigurationSettings.AppSettings["Port"],
+
+ ConfigurationSettings.AppSettings["SSL"]);
+
+ Console.WriteLine("SetUp {0}", connString.ToString());
+
+ }
+
+
+
+ [TearDown]
+
+ public void TearDown()
+
+ {
+
+ }
+
+
+ [Test]
+ public void TestConfigFiles()
+ {
+ }
+
+ }
+
+}
+
+Config file:
+
+<?xml version="1.0" encoding="utf-8" ?>
+
+<configuration>
+
+ <appSettings>
+
+ <add key="User" value="administrador" />
+
+ <add key="Password" value="norma_comics" />
+
+ <add key="Database" value="test" />
+
+ <add key="DataSource" value="localhost" />
+
+ <add key="Port" value="5432" />
+
+ <add key="Connection lifetime" value="1" />
+
+ <add key="Pooling" value="false" />
+
+ <add key="Packet Size" value="8192" />
+
+ </appSettings>
+
+</configuration>