473,657 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NUnit web.config ASP.NET?

Hi!

When running NUnit tests against my ASP.NET application I want the values in
the web.config to be loaded, otherwise connectionstrin gs and other
configurations won't be availible and the tests will fail.

How do I load the web.config from the NUnit tests?

/Erik
Nov 18 '05 #1
2 2054
The name of the configuration file used by default can be
found on the Properties page for the NUnit project. Be
aware that a project is not created if all you do is open
a DLL through NUnit. Instead, start with a New|Project
and then load up the test fixture.

Hope this helps.

Bruce Johnson
http://www.ObjectSharp.com/Bruce
-----Original Message-----
Hi!

When running NUnit tests against my ASP.NET application I want the values inthe web.config to be loaded, otherwise connectionstrin gs and otherconfiguratio ns won't be availible and the tests will fail.
How do I load the web.config from the NUnit tests?

/Erik
.

Nov 18 '05 #2
Great! tnx!
"Bruce Johnson" <Br***@ObjectSh arp.removethis. com> wrote in message
news:00******** *************** *****@phx.gbl.. .
The name of the configuration file used by default can be
found on the Properties page for the NUnit project. Be
aware that a project is not created if all you do is open
a DLL through NUnit. Instead, start with a New|Project
and then load up the test fixture.

Hope this helps.

Bruce Johnson
http://www.ObjectSharp.com/Bruce
-----Original Message-----
Hi!

When running NUnit tests against my ASP.NET application

I want the values in
the web.config to be loaded, otherwise connectionstrin gs

and other
configuratio ns won't be availible and the tests will

fail.

How do I load the web.config from the NUnit tests?

/Erik
.

Nov 18 '05 #3

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

Similar topics

1
494
by: Klas Mellbourn | last post by:
I have several assemblies, in separate dll:s, each with nunit tests embedded. Every assembly requires its own config file. I would like to run all nunit tests on the same command line. Like this: > nunit-console.exe foo.dll bar.dll Both foo.dll.config and bar.dll.config exists in the same directory. What seems to happen, though, is that only one of the config files is loaded (bar.dll.config), wich causes my nunit tests in foo.dll to...
0
998
by: Mike | last post by:
I found this message posted from last year: I'm using NUnit to test my assembly. When my assembly runs (.exe) normally it uses it's .config file, but when I test my assembly using NUnit it wants to use the NUnitGUI.exe.config which is understandable. I'm wondering can I tell my app to think that a different file is its
1
1705
by: Peter Rilling | last post by:
When running my unit tests for our web project, I am having a difficult time getting values from the config file. When running from the web server, the config file is able to be read from the web.config. When I run from nUnit, I get a null. I added our config settings to the nunit-gui.exe.config, but no luck. Am I missing something.
6
6069
by: tchaiket | last post by:
Hey all, I'm using NUNIT to test our classes. However, I don't want to hard code test data into the NUNIT classes. For example, to test adding a new Client, I don't want to hard code the Client Name, phone number, email, etc. I want to the NUNIT to read this data from a file. This way I can change the data in a file easily and test various types of test data. I think this can be done using the CONFIG file that NUNIT reads. Is
1
1962
by: Gonza | last post by:
Hi group, i'm trying to create tests for my solution, so i have a project with nunit tests. I'm using the data application block as my data access layer, and the problem i'm having is that when i try to run a test that uses the block i get an exception because the block can't read the configuration file (i supose it doesn't know where to look) and therefore can create a connection to the database. Any ideas? Thanks in advance
1
2994
by: nyathancha | last post by:
Hi, I am using WSE to implement security using x509 certificates. This works when I use a windows client but throws an exception when I use NUnit. My Code looks as follows : UsernameToken myCurrentToken = new UsernameToken("xxxx", "YYY", PasswordOption.SendPlainText); MyServicesWse adminServices = new MyServicesWse();
2
3177
by: chris | last post by:
I have created a file, called nunit_project_name.dll.config, within the bin folder of my Nunit project, but Nunit is not able to find the file. Is this is the right location? I can access the proper connection string if I put in in the machine.config file, but obviously this is not the best choice. I must be putting the file in the wrong dir, but I have tried pretty much every location that I can think of. Help would be greatly...
1
429
by: skneife | last post by:
Hi! When running NUnit tests against my ASP.NET application I want the values in the web.config to be loaded, otherwise connectionstrings and other configurations won't be availible and the tests will fail. How do I load the web.config from the NUnit tests? Sam
2
2234
by: Mark Elliott | last post by:
Hi All, I'm just playing with asp.net mvc and link-to-sql for the first time. I'm using visual web developer 2008. I create the project fine, choose nunit as my test framework in the wizard. Everything is fine, compiles and the tests work fine on the basic application. However once I add some linq things to it, and specifically the line: WestoriaDataContext westoria = new WestoriaDataContext();
0
8403
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
8316
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8737
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...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7345
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...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2735
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
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.