Theoretical basis
For a reference to how to create a unit test project on WP8, here is a documentation for MSDN first.
Http://msdn.microsoft.com/en-us/library/windowsphone/develop/dn168930%28v=vs.105%29.aspx
The article clearly describes the steps to build a Windows Phone unit test project.
But what we need for continuous integration is to do the result collection of unit tests through the command line. Based on the MSDN documentation, we can run unit tests through command line Vstest.console.exe.
Installation directory is here:
C:\Program Files (x86) \microsoft Visual Studio 11.0\common7\ide\commonextensions\microsoft\testwindow
How to use:
Vstest.console D:\Projects\BankAccountTest\Bin\x86\Debug\BankAccountTest_Debug_x86.xap
Practice
Create a Unittestproject (vs2012 Update2 later version support):
To add a simple test code:
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/
Compile this test project, go to the output directory, run Vstest.console try:
It works:-).
Summarize
1, so we can configure a script to automatically build the code, the build is completed and then call this command run unit test, 100% after the completion of the build.
With such continuous integration, automated builds are no longer a dream for apps on WP.
2, for the Codecoverage statistics, search the following results found:
Currently, Codeconverage statistics are not supported for Windows Store and Windows Phone programs.