473,654 Members | 3,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unit-testing applications that use the Microsoft.Patte rns.EnterpriseL ibrary.Data

From: da**********@gm ail.com (CtrlAltDel)
Newsgroups: microsoft.publi c.dotnet.datato ols
Subject: Unit-testing applications that use the
Microsoft.Patte rns.EnterpriseL ibrary.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
dataconfigurati on file :

1) MyBusinessObjec t.Tests.Registr ationFixture.Si mpleRegistratio n :
System.Configur ation.Configura tionException : Invalid section name.
The section 'dataConfigurat ion' does not exist in the requested
configuration file
'E:\Inetpub\www root\MyApplicat ion\MyBusinessO bject.Tests\bin \Debug\MyBusine s
sObject.Tests.d ll.config'
or the file
'c:\winnt\micro soft.net\framew ork\v1.1.4322\C onfig\machine.c onfig'.
Make sure that the 'enterpriseLibr ary.configurati onSections'
configuration section exists in one of the files and that the section
'dataConfigurat ion' is defined.
at
Microsoft.Pract ices.Enterprise Library.Configu ration.Configur ationBuilder.Va l
idateSection(St ring
sectionName)
at
Microsoft.Pract ices.Enterprise Library.Configu ration.Configur ationBuilder.Re a
dConfiguration( String
sectionName)
at
Microsoft.Pract ices.Enterprise Library.Configu ration.Configur ationContext.Ge t
Configuration(S tring
sectionName)
at
Microsoft.Pract ices.Enterprise Library.Data.Da tabaseConfigura tionView.GetDat a
baseSettings()
at
Microsoft.Pract ices.Enterprise Library.Data.Da tabaseConfigura tionView.GetDef a
ultInstanceName ()
at
Microsoft.Pract ices.Enterprise Library.Data.Da tabaseProviderF actory.GetDefau l
tInstanceName()
at
Microsoft.Pract ices.Enterprise Library.Configu ration.Provider Factory.CreateD e
faultInstance()
at
Microsoft.Pract ices.Enterprise Library.Data.Da tabaseProviderF actory.CreateDe f
aultDatabase()
at
Microsoft.Pract ices.Enterprise Library.Data.Da tabaseFactory.C reateDatabase()
at MyBusinessObjec t.Application.S ave() in
E:\Inetpub\wwwr oot\MyApplicati on\MyBusinessOb ject\Applicatio n.cs:line
96
at MyBusinessObjec t.Tests.Registr ationFixture.Si mpleRegistratio n()
in
E:\Inetpub\wwwr oot\MyApplicati on\MyBusinessOb ject.Tests\Regi strationFixture .
cs:line
90

I created an app.config and a dataconfigurati on.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 EnterpriseLibra ry?

Nov 22 '05 #1
0 1902

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

Similar topics

5
3686
by: Bob | last post by:
Are they different names for the same concept ?
1
1368
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 and its handler. I then tried to add a Unit test case for the handler, using Test>New Test>Unit Test Wizard. The handler for the button is not seen the the list of functions available to be unit tested. The Form1 class itself is not listed. On a...
5
2495
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 // --- begin code ---
4
1353
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 stop and point out his error. Does Python (or SciPy or ..) offer this feature? Thanks for your help.
2
1867
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 easy-to-use tool for unit tests? I appreciate your suggestion. Bests,
5
3010
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. Some of the inputs can be either monetary or percantage. The ideal scenario is where the user enters the value and immediately to the right of the value field is a drop down, defaulted to %,which allows a currency to be selected.
6
2071
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 think that the class itself should include unit tests, especially since it has to reference nunit.framework in order to compile/work, and I don't want to have to distribute the nunit.framework.dll with this class. So I created a new project,...
1
3329
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 sending a command to a hardware device, and if it does not answer in the timeout defined (i.e. in 2 sec), my software fires an exception. Now, I am writing an unit test in which I start a timer and I send the command. Note that I DO expect an...
176
8331
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 their own unit test framework, and then in a lab session see if I can get them to write their own. To give them an example I've created the following UTF class (with a simple test program following). I would welcome and suggestions on how anybody...
1
3439
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 is. Here's a failure example: I created a simple little C# program called Test1. I added a new class that has a public method Sum, which does the brilliant function of adding two numbers together and returning the result. I added a unit test...
0
8376
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8708
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8489
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7307
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.