473,382 Members | 1,086 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,382 software developers and data experts.

Passing connectin string dynamically to Nunit

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>


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

</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
Oct 31 '07 #1
4 2124
debasisdas
8,127 Expert 4TB
Question moved to .NET Forum.
Oct 31 '07 #2
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>


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

</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 2 '07 #3
kenobewan
4,871 Expert 4TB
You need to use the configuration appsettings to read these values to place in your connection string.

Please do not double post, the two threads have been merged.

MODERATOR
Nov 2 '07 #4
Hi Thanks for you reply

If u have any sample please give it to me I am new to Nunit...

Please explani me clearly how should i proceed with this problem..

regards
Prashant


You need to use the configuration appsettings to read these values to place in your connection string.

Please do not double post, the two threads have been merged.

MODERATOR
Nov 5 '07 #5

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

Similar topics

1
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: ...
3
by: lanky_tx | last post by:
Hi All, We have an automated build and test environment using NAnt and Nunit. Some of our assemblies are being strong named by modifying the AssemblyInfo.cs and having csc compile it. Some of...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
2
by: d2d | last post by:
How are you doing there folks? I just have this newbie question about how to compile an NUnit test file from command line using "csc.exe" I installed NUnit 2.1 using *.msi file. I was...
0
by: Ray Tayek | last post by:
hi, getting a: .\Stdafx.cpp : fatal error C1192: #using failed on 'i: nunit\samples\cpp-sample"' 'The filename, directory name, or volume label syntax is incorrect.' nunit is installed in...
6
by: Ray Tayek | last post by:
hi, i am preparing to teach a class in c++ and would like to intoduce some unit testing. i can make unit tests in c# using this dll and nant from the command line. i am using visual c++ 2005...
20
by: Parag | last post by:
Hi, I am trying to figure out best testing tool for my project. I have narrowed down my requirements to two tools NUNIT and VSTS unit. But I have used neither and I have to use only one of them....
2
by: JohnGoogle | last post by:
Hi, I'm a newbie so sorry if there is a simple answer to this! I'm using C# in Visual Studio Express at the moment. I've downloaded NUnit v 2.2.8 and can load and run the tests they supply...
2
by: honavar | last post by:
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.