Re: Problem with a "local" configuration file

"Charlie Poole" <[email protected]> Tue, 9 Sep 2008 03:50:44 -0700
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <004c01c91269$ea763050$6401a8c0@ferrari>
Hi Sergey,

When you run using an nunit project file, you normally need
a config file named MyProject.config for MyProject.nunit.

See the page on config files in the docs for details.

Charlie 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf 
> Of Sergey Popov
> Sent: Tuesday, September 09, 2008 1:07 AM
> To: [email protected]
> Subject: [Nunit-users] Problem with a "local" configuration file
> 
> Hi All!
> 
> I've got a problem with a "local" configuration file. I 
> created a simple project to illustrate the problem:
> http://207.168.43.174/ConfBug.zip
> 
> If I run the test directly it completes successfully. But if 
> I use NUnit Project the test is failed!
> 
> "%ProgramFiles%\NUnit 2.4.8\bin\nunit-console.exe"
> bin\Debug\ConfBug.dll - success!
> "%ProgramFiles%\NUnit 2.4.8\bin\nunit-console.exe" 
> ConfBug.nunit - failed!
> 
> Please, help me find the problem.
> 
> Thank you,
> Sergey.
> 
> 
> ConfBugTest.cs:
> --------------------------------------------------
> using System;
> using System.Collections.Specialized;
> using System.Configuration;
> 
> using NUnit.Framework;
> using NUnit.Framework.SyntaxHelpers;
> 
> namespace ConfBug
> {
>     [TestFixture]
>     public class ConfBugTest
>     {
>         [Test]
>         public void Test1()
>         {
>             NameValueCollection values =
> ConfigurationManager.GetSection("MySection") as NameValueCollection;
> 
>             Assert.That(values, Is.Not.Null);
>         }
>     }
> }
> 
> 
> App.config:
> --------------------------------------------------
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
>     <configSections>
>         <section name="MySection"
> type="System.Configuration.NameValueSectionHandler" />
>     </configSections>
>     <MySection>
>         <add key="MyKey" value="MyValue" />
>     </MySection>
> </configuration>
> 
> 
> ConfBug.nunit:
> --------------------------------------------------
> <NUnitProject>
>   <Settings activeconfig="Debug" />
>   <Config name="Debug" binpathtype="Auto">
>     <assembly path="bin\Debug\ConfBug.dll" />
>   </Config>
>   <Config name="Release" binpathtype="Auto" /> </NUnitProject>
> 
> --------------------------------------------------------------
> -----------
> This SF.Net email is sponsored by the Moblin Your Move 
> Developer's challenge Build the coolest Linux based 
> applications with Moblin SDK & win great prizes Grand prize 
> is a trip for two to an Open Source event anywhere in the 
> world http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Nunit-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nunit-users
> 



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/