Running All Unit Test cases from a project and Devpartner
-
Friday, February 03, 2012 11:03 AM
I have three projects in my Visual studio soltuion:
1. Web Project. -- Web application
2. Business Logic
3. DAL Logic
4.Unit Test Project -- It has all unit tests.
5. Unit test runner project -- simple windows application with one form with one label and button control on it.
Actually i want to run all my unit test cases from Unit Test runner project. I wrote a piece of code that will execute when button will be clicked in unit test runner project.Code is below:
TestSuiteBuilder builder = new TestSuiteBuilder();
TestSuite suite = builder.Build(@"C:\DevTest\Cost\Cost.NUnitTestRunner\bin\Debug\Cost.UnitTests.dll");
TestResult result = suite.Run(new NullListener());
lblMessage.Text =@"Done.";
This is the code to do code coverage analysis using Devpartner. Code is throwing erroe as Child Test case failed.
When i run my unit test project individually, all the unit test cases are passing successfully.
I basically want to know how to use devpartner to do code coverage analyisis using a runner project like this.
- Edited by nkush Friday, February 03, 2012 11:05 AM
- Edited by nkush Friday, February 03, 2012 11:06 AM
- Edited by nkush Friday, February 03, 2012 11:06 AM
- Edited by nkush Friday, February 03, 2012 11:06 AM
- Moved by Leo Liu - MSFT Monday, February 06, 2012 5:07 AM Moved for better support. (From:Visual C# General)
All Replies
-
Friday, February 03, 2012 6:14 PM
Hi nkush
Please Post your question in proper forum. your question is regarding Testing Forum
Post your question in below Testing Forum
http://social.msdn.microsoft.com/Forums/en/vsunittest/threads
Regards
Rozy
-
Tuesday, February 21, 2012 9:08 PMOwner
I am not exactly sure how DevPartner's piece work or interact with the VS solution, maybe a post to them might help. If you are trying to automate the testing process after a build try these:
http://msdn.microsoft.com/en-us/library/ms182465.aspx
http://www.csharptocsharp.com/visual-studio-automate-unit-testingMaybe once the build is setup, you can call your runner app to call the build.
Trevor Hancock (Microsoft)
Please remember to "Mark As Answer" the replies that help.

