473,756 Members | 5,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nunit..

I have started using this on a regular basis and have a question regarding
conditional compilation.

I have all my test cases wrapped in an #if/#endif that checks to see if the
build is debug or not so when I do a release build I am not compiling in the
test cases. This seems to be working all fine and dandy, but I was wondering
if there is a way to remove the reference to the nunit assembly for a
release build as well.
Nov 20 '05 #1
2 1316
While it does not remove the reference, I wrap all of the Import
NUnit.Framework statements in #If/#End If's also. Given the way that
the JITer works, this means that the DLL will never be loaded in the
release build.

HTH

David

"Ray Cassick (Home)" <rc************ @enterprocity.c om> wrote in message
news:#E******** ******@tk2msftn gp13.phx.gbl:
I have started using this on a regular basis and have a question
regarding
conditional compilation.

I have all my test cases wrapped in an #if/#endif that checks to see if
the
build is debug or not so when I do a release build I am not compiling in
the
test cases. This seems to be working all fine and dandy, but I was
wondering
if there is a way to remove the reference to the nunit assembly for a
release build as well.


Nov 20 '05 #2
Ray,
When I create a project I normally separate most of the logic into different
DLL files, the main EXE normally calls into these dlls.

What this allows me to do is to put all my nunit tests into their own dll,
thus not needing to use #if/#endif statements... Nor worry about the
reference to the nunit framework dll.

Hope this helps
Jay
"Ray Cassick (Home)" <rc************ @enterprocity.c om> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
I have started using this on a regular basis and have a question regarding
conditional compilation.

I have all my test cases wrapped in an #if/#endif that checks to see if the build is debug or not so when I do a release build I am not compiling in the test cases. This seems to be working all fine and dandy, but I was wondering if there is a way to remove the reference to the nunit assembly for a
release build as well.

Nov 20 '05 #3

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

Similar topics

6
1970
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 checked into VSS along with all the associated projects. Many developers need to work on the same solution. The problem that I am having is getting a consistent unit test system setup so that it can easily be shared. Basically, in order to run...
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...
2
14243
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 following examples that came with NUnit and when I tried to compile Nunit test file here is the error i received: ========================================================================
1
2167
by: Justin D. Fisher | last post by:
Anyone out there use NUnit for unit level testing on VB.Net? I see lots of C# documentation out there but very little for VB.Net? Can anyone suggest some books or web sites that address this?
0
1676
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 i"\nunit. does anyone know what the problem here is? any pointers will be appreciated.
6
8379
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 express at home (the labs may have an earlier version). does anyone know how to tell visual studio to use this dll? thanks
20
2021
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. Hence can someone who has used them before share his/her experience on them so that I can get a better idea and make a proper choice ? Any link or suggestions are also welcome. Thanks and Regards, Parag
6
6080
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
2
5157
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 (e.g. nunit.util.tests.dll) so the install of NUnit seems OK. I've compiled one of the sample projects (csharp-sample_VS2005). When I do so I get the following warning after a build:
1
3003
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();
0
9455
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
9869
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
9838
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
9708
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
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5140
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...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
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
3
2665
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.