473,395 Members | 2,796 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,395 software developers and data experts.

Passing parameters to Nunit test case at runtime

Hi all,

I have written Nunit test case using C#. I am testing the classes of some XYZ driver. I am using same database located in different server for example server1 and server2.

My config file is

<configuration> <appsettings> <add value="server1" key="x" /> </appsettings>
</configuration>

when i execute the test case then it will execute with server1

Now the question is:
I want to execute the same test case with server2

How can i pass connection string of server2 to test case dynamically or run time

please help me

Reagrds
Prashant
Nov 26 '07 #1
2 4583
kenobewan
4,871 Expert 4TB
Whether they are selected dynamically or not you still have a method to select. If its at run time it not based on user events. So what is your selection criterior - random?
Nov 26 '07 #2
Whether they are selected dynamically or not you still have a method to select. If its at run time it not based on user events. So what is your selection criterior - random?
Hi

Thanks for ur reply..

yes..randomly i need to select the server type.

I need to test these test case with two different servers..but currently I am testing with two servers using config file.by commenting one server connection string. but i need to test the test cases but i need to pass the connection dynamically. both connection string should be active. If I give conection1 as a parameter to test case at run time the test case as to execute with connection1 then the same test case if i give connection2 as parameter at run time it has to execute with connection2.


Please help me in solving this issue..If you have any sample please send me the link.

regards
Prashant
Nov 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Peter Rilling | last post by:
My development team is using VS.NET with VSS integration. They are able to check in and out from within VS.NET. We also use NUnit for testing our libraries. Currently our entire solution is...
2
by: Sky Kim | last post by:
Hi, all. I've know NUnit for a while, now I try to use it. Most of application I develope is data base driven. I want to test data layer most with may input and checking the result, then compare...
7
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException...
0
by: stephan | last post by:
I know that this has been beaten to death but I can't seem to resolve my issues (I have 2 of them). I have created a class that exposes a public method which returns a datatable as a datasource...
5
by: Naveen Mukkelli | last post by:
Hi all, How can we use "NUnit" in socket programming. I mean, I'm writing a server program which accepts connection requests from the clients. I want to test the number of clients whenever a...
3
by: Julia | last post by:
Hi, We are going to invest in testing and I wonder are there any guidelines to design NUnit friendly classes? Should I consider at all ease of use in unit testing when designing my classes? ...
4
by: Frank Rizzo | last post by:
I have a DLL that relies on an XML file (that's in the same folder as the DLL) to read some startup information. When I test my DLL, it seems like NUnit actually copies the DLL into some temp...
0
by: angshuman.agarwal | last post by:
Hi, I have a owner drawn combo box (using .Net 2.0 Framework). I have written the Nunit test for the same. I am setting the AutoCompleteSource Property (AutoCompleteSource.CustomSource) and...
4
by: honavar | last post by:
Hi all, I have written Nunit test case using C#. I am using same database located in different server for example server1 and server2. My config file is <configuration> <appSettings>
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...
0
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,...
0
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...
0
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...
0
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...
0
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...
0
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,...

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.