views:

969

answers:

3

I've written a console application that has a number of unit tests and I'm wanting to include it in my nant build script so that it will be run on our TeamCity CIS.

Unfortunately I'm not quite sure how to do that. The nant script has examples of current projects that have been added...they they all have to supply the assemblies that need to be tested. ie MyProject.dll But my console app doesn't have anything like that since it compiles into MyProject.exe

There must be a way to automate these tests since I'm able to run the unit tests from within Visual Studio without issue.

Does anyone know if and how this is possible?

A: 

What Test framework do you use for those tests? You've mentioned Visual Studio, I may guess it is mstest. TeamCity added support for MSTest starting from 4.0 for sln2008 build runner.

Could you please have a look to a full list of supported .NET unit test frameworks at http://www.jetbrains.net/confluence/display/TCD4/.NET+Testing+Frameworks+Support

Any way, have a look to custom unit tests integration manual pages at http://www.jetbrains.net/confluence/display/TCD4/Build+Script+Interaction+with+TeamCity

Eugene Petrenko
Well technically this question has been answered by Gishu (http://stackoverflow.com/users/1695/gishu) in the first comment to the question. I'm just waiting for him to write his comment up as an answer before I accept someone's answer...
mezoid
A: 

I've just noticed xUnit tag. xUnit supports TeamCity. Please refer to http://www.codeplex.com/xunit/WorkItem/View.aspx?WorkItemId=4278 for more details.

Eugene Petrenko
I must admit I've only heard about xUnit.net recently. Typically I use the tag xUnit to mean one of the members of a family of unit testing frameworks ie MBUnit, JUnit, NUnit etc...I guess that'll have to change now... but to what? *Unit? LOL
mezoid
+2  A: 

The answer to this question is that you add the name of the executable in the same place you add the list of DLL assemblies. The set of unit tests is compiled into the executable instead of into a separate dll file.

Gishu is the one who should take credit for this answer...since he answered me via a comment...however, I'm wanting to mark this question as answered so I'm writing up the answer so others can benefit from the solution.

Gishu, if you ever come back to this question, please feel free to write up your comment as an answer and I'll change the accepted answer to yours.

mezoid
The answer is here... that's all that matters. Your intent is appreciated. Thanks.
Gishu
No worries! :) Thanks for helping me out on this problem!
mezoid