473,903 Members | 6,268 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unit testing with multi-project solution question.

Hi,

Currently, I've got all my unit tests in a separate class in the same
project.
Instead of this, I'm planning to move all my tests in a separate project
in a single
solution.

For example let "TargetProj ect" is the main project in a solution. My plan
is to have another project, for example "TestTargetProj ect" that will
contain all
the unit tests ,in the same solution. Is this o.k. to do.

while doing this, I have created a new project(empty project) for my unit
tests
and added a C# file with my tests but I couldn't build the solution. When I
tried to
add a referece of the target project to the new test project, it is
accepting only .dll
files but not .exe files.

All my target project are of type either "console applicaitons" or
"windows applications" that produce .exe but not .dlls. In this case do I
need to
rebuild all of them to produce a .dll.

Is there any way I can add referece of the target projects to the test
projects.
Kindly let me know.

I'm using C#.NET

Cheers,

Naveen.
Nov 17 '05 #1
2 2114
"Naveen Mukkelli" <Na************ @discussions.mi crosoft.com> wrote in
message news:E0******** *************** ***********@mic rosoft.com...
Currently, I've got all my unit tests in a separate class in the same
project.
Instead of this, I'm planning to move all my tests in a separate project
in a single
solution.


Yes you have a problem. The other problem you will have is being able to
test private methods of TargetProject.

IMO it is best to leave your organization as is.

-- Alan
Nov 17 '05 #2
From what I've heard, in Whidbey, you can make a reference to an EXE but not
in the current version of Visual Studio.

You can either break your EXE app into an EXE and a DLL, and then have your
unit tests simply test the DLL, or you can leave the unit tests in your EXE
and set up the Release compilation to exclude the unit test classes.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Naveen Mukkelli" <Na************ @discussions.mi crosoft.com> wrote in
message news:E0******** *************** ***********@mic rosoft.com...
Hi,

Currently, I've got all my unit tests in a separate class in the same
project.
Instead of this, I'm planning to move all my tests in a separate project
in a single
solution.

For example let "TargetProj ect" is the main project in a solution. My plan
is to have another project, for example "TestTargetProj ect" that will
contain all
the unit tests ,in the same solution. Is this o.k. to do.

while doing this, I have created a new project(empty project) for my unit
tests
and added a C# file with my tests but I couldn't build the solution. When
I
tried to
add a referece of the target project to the new test project, it is
accepting only .dll
files but not .exe files.

All my target project are of type either "console applicaitons" or
"windows applications" that produce .exe but not .dlls. In this case do I
need to
rebuild all of them to produce a .dll.

Is there any way I can add referece of the target projects to the test
projects.
Kindly let me know.

I'm using C#.NET

Cheers,

Naveen.

Nov 17 '05 #3

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

Similar topics

38
3424
by: Christoph Zwerschke | last post by:
In August 2001, there was a thread about the "Art of Unit Testing": http://groups.google.com/group/comp.lang.python/browse_frm/thread/aa2bd17e7f995d05/71a29faf0a0485d5 Paul Moore asked the legitimate question why there is no hook for a "global" fixture code that is run only once for the whole TestCase, as opposed to the normal "setUp" and "tearDown" code that is run for every single test in the TestCase. A "global fixture" would be...
14
2768
by: | last post by:
Hi! I'm looking for unit-testing tools for .NET. Somthing like Java has --> http://www.junit.org regards, gicio
4
2170
by: Peter Rilling | last post by:
Does VS.NET 2005 Professional support integrated unit testing, or is that only with the team system?
72
5300
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: http://geosoft.no/development/unittesting.html Thanks.
7
1888
by: Diffident | last post by:
Hello All, Can anyone please suggest me a good unit testing tool. I have seen NUnit but not sure on how I can use it to test my methods which involve session variables, viewstate variables, textbox values. I understand that NUnit is more suitable for OO methods which take set of parameters and return an output parameter. How about tools for testing methods which use state variables and form values?
4
18974
by: Dat AU DUONG | last post by:
Hi, I am new to Unit testing, could you tell me where I could find information (hopefully step by step) and what is the benefit of unit testing. I am a sole developer in a company, therefore I don't get expose to much of this technology. Thanks in advance. Regards Dat.
5
6537
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 I can not work out a way to use it to test GUI code. Thanks a lot!
176
8558
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write their own unit test framework, and then in a lab session see if I can get them to write their own. To give them an example I've created the following UTF class (with a simple test program following). I would welcome and suggestions on how anybody...
5
2250
by: Ben Finney | last post by:
Howdy all, PEP 299 <URL:http://www.python.org/dev/peps/pep-0299details an enhancement for entry points to Python programs: a module attribute (named '__main__') that will be automatically called if the module is run as a program. The PEP has status "Rejected", citing backward-compatibility issues, and Guido's pronouncement that "It's not worth the change (in docs, user habits, etc.) and there's nothing particularly broken."
2
1866
by: mo.sparrow | last post by:
Typemock Isolator – A powerful mocking framework for .NET unit testing and Test Driven Development (in Visual Studio). http://www.typemock.com/learn_about_typemock_isolator.html NUnit - A unit testing framework development software that is open source written in C# (for Visual Studio). TestDriven.NET - .NET Unit Testing software development tool / developer tool (add-in) for Visual Studio .NET www.testdriven.net/
0
9848
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
11284
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10876
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
10501
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
9687
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
7208
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
5894
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
4727
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
3324
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.