最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - How to perform line coverage analysis for a library when executed by an external exe in visual studio? - Stack Overflow

programmeradmin5浏览0评论

I am working with 2 C# solutions: A library project (DLL) that contains the core logic. An executor project (EXE) that runs the library by calling its methods.

I want to measure line-by-line code coverage for the library while it is being executed by the EXE. I want to do this because I want to figure out which lines are actually used for a given input. I would like to see coverage directly in Visual Studio (e.g., with covered lines in green and uncovered lines in red) as provided by the fine code coverage extension.

I installed Fine Code Coverage extension for visual studio and ran a unit test in the library solution that calles the exe.

var process = new Process { 
StartInfo = { 
   FileName = "Path\\to\\executor.exe" } 
   Arguments = "Path\\to\\libconfig.json"}; 
process.Start();)

When I execute the unit test the exe runs the libray but no line coverage appears in the library solution except for the units tests.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论