.net – How to automate unit tests for a console application in TeamCity

automated-testsconsole-applicationnantteamcityxunit.net

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?

Best Solution

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.