473,395 Members | 1,516 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.

Unit Test configure file

Hello, In a Unit test with visual studio 2005

I have this code in the test assembly:
1.System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.None);
2.ConnectionStringsSection csSection = config.ConnectionStrings;
3.ConnectionStringSettings cs =
csSection.ConnectionStrings[GABTSAUDITORIA_CONEXION];
4.ConnectionString = cs.ToString();

5.ConnectionString =
ConfigurationManager.ConnectionStrings[GABTSAUDITORIA_CONEXION].ConnectionString;

I have that write the file of configuration of this way:
[ClassInitialize()]
public static void InicializacionPruebas(TestContext testContext)
{
if (!File.Exists("vstesthost.exe.config"))
{
File.Copy(FICHERO_CONFIGURACION, "vstesthost.exe.config");
}
But if the assembly not contain the lines 1,2,3,4 then Where and How I have
to write the file of configuration?
Thanks

Jun 8 '06 #1
1 4161
Hola, ya tengo la solución:
Con el nuevo código hay que poner un fichero de configuración con el nombre
user.config:
if (!File.Exists("user.config"))
{
File.Copy(FICHERO_CONFIGURACION, "user.config");
}
"fran" wrote:
Hello, In a Unit test with visual studio 2005

I have this code in the test assembly:
1.System.Configuration.Configuration config =
ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.None);
2.ConnectionStringsSection csSection = config.ConnectionStrings;
3.ConnectionStringSettings cs =
csSection.ConnectionStrings[GABTSAUDITORIA_CONEXION];
4.ConnectionString = cs.ToString();

5.ConnectionString =
ConfigurationManager.ConnectionStrings[GABTSAUDITORIA_CONEXION].ConnectionString;

I have that write the file of configuration of this way:
[ClassInitialize()]
public static void InicializacionPruebas(TestContext testContext)
{
if (!File.Exists("vstesthost.exe.config"))
{
File.Copy(FICHERO_CONFIGURACION, "vstesthost.exe.config");
}
But if the assembly not contain the lines 1,2,3,4 then Where and How I have
to write the file of configuration?
Thanks


Jun 9 '06 #2

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

Similar topics

2
by: Edvard Majakari | last post by:
Hi all ya unit-testing experts there :) Code I'm working on has to parse large and complex files and detect equally complex and large amount of errors before the contents of the file is fed to...
72
by: Jacob | last post by:
I have compiled a set og unit testing recommendations based on my own experience on the concept. Feedback and suggestions for improvements are appreciated: ...
3
by: Dick | last post by:
How do you configure VS to compile your solution before running unit tests?
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: shuisheng | last post by:
Dear All, I was told that unit test is a powerful tool for progamming. If I am writing a GUI code, is it possible to still using unit test? I have a little experience in using unittest++. But...
3
by: Anja | last post by:
Hello everyone, I have a question about the Cxxtest framework which I am considering using for all my C++ unit testing needs. I am wondering if it is possible to configure the framework so...
1
by: rich_sposato | last post by:
I released version 2.0 of C++ Unit Test Library. You can download it from SourceForget.Net at http://sourceforge.net/projects/cppunittest/ .. I wrote this unit test library because other unit...
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...
27
by: brad | last post by:
Does anyone else feel that unittesting is too much work? Not in general, just the official unittest module for small to medium sized projects? It seems easier to write some quick methods that are...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...
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
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...

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.