Visual Studio Unit Test in large Solution - Layout

S

sippyuconn

I was wonder if there is any protocol or suggestions on how to setup unit
testing projects in large solution???

If you have a large solution of say 50 projects and add a project for every
unit test it could get overwhelming - is there some standards on how to set
this up???


Has anyone integrated this into Continuous Integration ???

Thanks
 
B

Brian Gideon

I was wonder if there is any protocol or suggestions on how to setup unit
testing projects in large solution???

If you have a large solution of say 50 projects and add a project for every
unit test it could get overwhelming - is there some standards on how to set
this up???

Has anyone integrated this into Continuous Integration ???

Thanks

I use NUnit and what I do is add a project to the solution that is
used exclusively as a container for unit tests. I then reference the
other projects and write unit tests that excersise the public API from
each.

I have toyed with the idea of adding unit tests directly to each
individual project and using the conditional compilation mechanisms
for determining whether they should be included in a release or debug
build. Has anyone else had a good experience with this method?
 
L

Linda Liu[MSFT]

Hi Sippyuconn,

Generally speaking, we create a test project for a project to be tested. So
if you have 50 projects, you create 50 test projects. Each test project
contains test classes as many as the classes in the project to test. Each
test class in the test project contains test methods as many as the methods
in the class to test.

To create a test project for a project, open the code editor for a class in
the project and right-click the namespace and select 'Create Unit Tests'.

To manage large numbers of tests, you can use the Test Manager window to
organize tests into hierarchical structure. This structure consists of test
lists, which helps to have the capability of visualizing the tests in
groups or lists. You can also run the tests in a list by first selecting
the list in the Visual Studio IDE, or you can run the tests in a list using
the command-line test utility.

For more information on generating Unit Tests and managing large numbers of
tests, see the following MSDN documents:
'How to: Generate a Unit Test'
http://msdn.microsoft.com/en-us/library/ms182524.aspx

'Walkthrough: Managing Tests Using Lists and Properties'
http://msdn.microsoft.com/en-us/library/ms182466.aspx

Hope this helps.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top