如何在Visual Studio中使用OpenCover代码覆盖率运行NUnit测试?

编程入门 行业动态 更新时间:2024-10-28 19:30:39
本文介绍了如何在Visual Studio中使用OpenCover代码覆盖率运行NUnit测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是NUnit测试的新手.我能够为我的函数编写测试用例,现在我想要知道的是测试用例的代码覆盖率.为此,我使用OpenCover.但是我不知道如何安装OpenCover并将其与Visual Studio 2015一起使用,有人可以指导我安装OpenCover for Visual Studio并提供帮助以查看Visual Studio中的代码范围吗?

I am new to NUnit testing. I was able to write test cases for my functions, now what I want is to know the code coverage for my test cases. For that I use OpenCover. But I don't know how to install and get OpenCover to work with Visual Studio 2015, can anyone guide me to install OpenCover for Visual Studio and provide help to see the code coverage in Visual Studio?

推荐答案

我在Visual Studio中发现的代码覆盖率最佳解决方案如下:

  • 打开Visual Studio 2017
  • 转到工具"->扩展和更新"
  • 转到在线",在搜索(窗口右上方)中键入 " AxoCover "
  • 点击安装",然后按照说明进行操作(即,关闭Visual Studio,以 开始安装)
  • 重新打开Visual Studio
  • 构建项目
  • 转到工具"->"AxoCover"
  • 在测试"标签下,右键单击您的顶级目录,然后转到封面 测试"
  • 点击报告"标签
  • Open Visual Studio 2017
  • Go to Tools->Extensions and Updates
  • Go to "Online", in the search (top right of the window) type "AxoCover"
  • Click install, follow the instructions (i.e. close Visual Studio to start the install)
  • Reopen Visual Studio
  • Build your project
  • Go to Tools->AxoCover
  • Under the "Tests" tab right click your top directory and go "Cover tests"
  • Click on the "Report" tab
  • 更多推荐

    如何在Visual Studio中使用OpenCover代码覆盖率运行NUnit测试?

    本文发布于:2023-11-14 10:45:47,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1587011.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:覆盖率   代码   测试   如何在   Visual

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!