Automated testing and continous integration of C# , WPF project

Is there a way to do automated testing and continous integration of C#, WPF projects? I thought about something like Jenkins but as far as I know Jenkins does not support C# projects. It should be a tool to do test driven development with the possibility to do automated testing, also for the GUI. Maybe the build tool form gitlab is an option?

Many thanks in advance!


We do use Jenkins with our C# projects. You may use the MSBuild plugin to build the projects, or use a "Windows Batch Command" like

"C:WindowsMicrosoft.NETFrameworkv4.0.30319MSBuild.exe" YourSolution.sln  /tv:4.0 /p:Configuration=Release /p:TreatWarningsAsErrors="true"  /p:CheckForOverflowUnderflow="true" /p:WarningLevel=4 /v:m /t:rebuild

Note: with this command line, I overwrite project specific settings for warnings and arithmetic overflow.

There are also plugins for Unit Tests. We use MSTest. Since I integrated the OpenCover Code Coverage Report Generator, I must use a long command line:

"C:Program Files (x86)OpenCoverOpenCover.Console.exe" "-target:C:vsCommon7IDEMSTest.exe" "-targetargs:/nologo /testcontainer:TestsProject1Tests.dll /testcontainer:TestsProject2Tests.dll /resultsfile:testresult.trx /category:"^!SqlTests^&^!Perfomance"" -output:coverage.xml
"C:Program Files (x86)OpenCoverOpenCoverToCoberturaConverter.exe" -input:coverage.xml -output:outputCobertura.xml -sources:%WORKSPACE%
"C:Program Files (x86)ReportGeneratorReportGenerator.exe" -reports:coverage.xml -targetDir:CodeCoverageHTML

Sadly, you mstest does not accept wild cards for the test projects, so you end up with a terribly long line. Also note that the above command line excludes test categories "SqlTests" and "Performance". Then the output is converted to a format accepted by other plugins.

You may start some virtual machines after the build and the unit tests, and install there your programs by some scripts complete with some test data and do some automated tests of the system.

For the GUI proper, we do not yet have a test strategy.


There are a lot of options to pick from if you are going to use out of the box MS Test. Otherwise you need to check if the service provider can support xUnit runner or other similar testing frameworks that could be used in your solution.

  • TFS / VisualStudio Online
  • TeamCity
  • Jekings with MSBuild
  • Bamboo
  • Appveyor
  • For UI Automation you could check White Framework. It is by far the nicest one in my opinion if compared to features and ease of use.

    链接地址: http://www.djcxy.com/p/50784.html

    上一篇: 有没有办法在源代码控制中保留Hudson / Jenkins配置文件?

    下一篇: C#,WPF项目的自动化测试和持续集成