469,602 Members | 1,818 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

Unit-testing applications that use the Microsoft.Patterns.EnterpriseLibrary.Data

From: da**********@gmail.com (CtrlAltDel)
Newsgroups: microsoft.public.dotnet.datatools
Subject: Unit-testing applications that use the
Microsoft.Patterns.EnterpriseLibrary.Data
Date: 15 Apr 2005 08:06:31 -0700

I've written a web application that uses the M.P.E.D namespace to do
all of its data layer tasks (and a nifty bit of code M.P.E.D is too!).
However, unit-testing is proving a bit of a problem, as the database
factory complains it is unable to locate the expected
dataconfiguration file :

1) MyBusinessObject.Tests.RegistrationFixture.SimpleR egistration :
System.Configuration.ConfigurationException : Invalid section name.
The section 'dataConfiguration' does not exist in the requested
configuration file
'E:\Inetpub\wwwroot\MyApplication\MyBusinessObject .Tests\bin\Debug\MyBusines
sObject.Tests.dll.config'
or the file
'c:\winnt\microsoft.net\framework\v1.1.4322\Config \machine.config'.
Make sure that the 'enterpriseLibrary.configurationSections'
configuration section exists in one of the files and that the section
'dataConfiguration' is defined.
at
Microsoft.Practices.EnterpriseLibrary.Configuratio n.ConfigurationBuilder.Val
idateSection(String
sectionName)
at
Microsoft.Practices.EnterpriseLibrary.Configuratio n.ConfigurationBuilder.Rea
dConfiguration(String
sectionName)
at
Microsoft.Practices.EnterpriseLibrary.Configuratio n.ConfigurationContext.Get
Configuration(String
sectionName)
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas eConfigurationView.GetData
baseSettings()
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas eConfigurationView.GetDefa
ultInstanceName()
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas eProviderFactory.GetDefaul
tInstanceName()
at
Microsoft.Practices.EnterpriseLibrary.Configuratio n.ProviderFactory.CreateDe
faultInstance()
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas eProviderFactory.CreateDef
aultDatabase()
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas eFactory.CreateDatabase()
at MyBusinessObject.Application.Save() in
E:\Inetpub\wwwroot\MyApplication\MyBusinessObject\ Application.cs:line
96
at MyBusinessObject.Tests.RegistrationFixture.SimpleR egistration()
in
E:\Inetpub\wwwroot\MyApplication\MyBusinessObject. Tests\RegistrationFixture.
cs:line
90

I created an app.config and a dataconfiguration.config in the root
directory of the unit test library, and added a post-build event to
VS.NET to copy the .config files to the bin/debug folder, and indeed
the files get copied there, but the tests are still failing. Any idea
how to unit tests apps written with the EnterpriseLibrary?

Nov 22 '05 #1
0 1716

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by VvanN | last post: by
4 posts views Thread by AbrahamLincolnIllinois | last post: by
2 posts views Thread by shuisheng | last post: by
5 posts views Thread by Lee | last post: by
6 posts views Thread by Michael Bray | last post: by
1 post views Thread by batvanio | last post: by
176 posts views Thread by nw | last post: by
1 post views Thread by Richard Lewis Haggard | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.