473,383 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 1877

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bob | last post by:
Are they different names for the same concept ?
1
by: yashgt | last post by:
Hi, I have installed Visual Studio 2005 Team Edition for Developers, on my Windows XP PC. The exact VS version is 8.0.50727.42. I created a simple Windows application in VB .NET and add a button...
5
by: VvanN | last post by:
hi, fellows I'd like to intruduce a new unit test framework for C++ freely available at: http://unit--.sourceforge.net/ It does not need bothering test registration, here is an example ...
4
by: AbrahamLincolnIllinois | last post by:
Greetings! I am working with a researcher who would be very happy if he could include units in his calculations. Then, if his complicated expression didn't result in "kg/yr" the program would...
2
by: shuisheng | last post by:
Dear All, I am using visual studipo 2005 (standard version which do not provide unit test tool) to develop some c++ code. I want to do unit test while I am coding. Anybody can suggest me an...
5
by: Lee | last post by:
Hi, Using the propertygrid, is it possible to have a user selectable 'unit of measure' for a field. For example, I am looking at using a propertygrid for defining inputs into a calculation. ...
6
by: Michael Bray | last post by:
I've just inherited a fairly large project with multiple classes. The developer also wrote a huge number of unit tests (using NUnit) to validate that the classes work correctly. However, I don't...
1
by: batvanio | last post by:
Hi, I am writing unit tests in VS2005 and am having the following problem: I am trying to test a timeout property of one of my methods. This timeout exhibits itself in an exceptioin - i.e. I am...
176
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write...
1
by: Richard Lewis Haggard | last post by:
We're using VS05 and today the units tests have stopped working in our development environment. I'm sure that it is something really silly and simple but I'll be darned if I can figure out what it...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.