在Visual Studio 2010 里使用Nunit 进行Debug 测试
1. 创建带测试类库的项目解决方案(详细方法参见Nunit Quick Start),如图:
下面一个是供Nunit 进行单元测试的。
2 选中测试类库,鼠标右键选择属性,调试
在启动操作 选项中,选择启动外部程序,并设置好Nunit 单元测试 Nunit.exe程序位置
3 打开 Nunit 安装目录,找到Nunit.exe.config
修改配置文件如下:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
The GUI only runs under .NET 2.0 or higher. The
useLegacyV2RuntimeActivationPolicy setting only
applies under .NET 4.0 and permits use of mixed
mode assemblies, which would otherwise not load
correctly.
-->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- Comment out the next line to force use of .NET 4.0
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v4.0.30319" /> -->
<requiredRuntime version="v4.0.30319" /> <!--添加该行配置,并只留这一个配置-->
</startup>
<runtime>
<!-- Ensure that test exceptions don't crash NUnit -->
<legacyUnhandledExceptionPolicy enabled="1" />
<!-- Run partial trust V2 assemblies in full trust under .NET 4.0 -->
<loadFromRemoteSources enabled="true" /> <!--该项配置为true-->
<!-- Look for addins in the addins directory for now -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;addins" />
</assemblyBinding>
</runtime>
</configuration>
4 为要测试的方法打上断点,选中测试类库为启动项,按F5运行
在Nunit 界面上运行要测试的方法,成功在断点上停下来
转载于:https://www.cnblogs.com/iampkm/archive/2012/10/10/2718088.html
在Visual Studio 2010 里使用Nunit 进行Debug 测试相关推荐
- Visual Studio 2010中国团队的研发内幕
--微软Visual Studio商业软件部总经理潘正磊专访 文 / 霍泰稳 常政 随着2010年4月12日微软官方正式颁布"Visual Studio 2010"的日期临近,无数 ...
- visual studio 2010卸载
visual studio 2010卸载教程 在网站上寻找了很多卸载方法,例如软件管家之类的,都尝试过,其实卸载的很麻烦,还要通过手动一个一个的去删除visual studio 2010的相关组件.现 ...
- error C2039: “staticMetaObject”: 不是“A”的成员 c:\Users\chuan\documents\visual studio 2010\Projects\Deriv
转载自:https://blog.csdn.net/weixin_39955229/article/details/81901603 原文标题:QObject多继承static_meta_object ...
- Visual Studio 2010工程目录下的ipch文件夹和.sdf文件
使用VS2010建立C++解决方案时,会生成SolutionName.sdf和一个叫做ipch的文件夹,这两个文件再加上*.pch等文件使得工程变得非常的庞大,一个简单的程序都会占用几十M的硬盘容量, ...
- visual studio 2010卸载教程
visual studio 2010卸载教程 在网站上寻找了很多卸载方法,例如软件管家之类的,都尝试过,其实卸载的很麻烦,还要通过手动一个一个的去删除visual studio 2010的相关组件.现 ...
- Visual Studio 2010的WAP网站开发
关于Visual Studio 2010的WAP网站开发,我归纳一下吧,来自官方网站的消息,Visual Studio 2010不支持对WAP网站的直接开发,可以使用早期版本的 V ...
- Visual Studio 2010旗舰版在安装Windows Phone 7 SDK后项目模版里没有Windows Phone 项目解决办法...
这个方法解决安装Windows Phone Develop Tools自带的Visual Studio 2010 Express for Windows Phone后,在已安装的Visual Stud ...
- Win7使用Visual Studio 2010编译用于Qt4.8.6的MySQL驱动
其实编译过程在Qt Creator 的帮助文档里有,我就是照着做的,但是没成功,因为不能照搬照抄! 1.确保path环境变量里有QTDIR,这个就不细说了. 2.打开"开始"-&g ...
- Visual Studio 2010在简洁中强调团队合作
Visual Studio 2010警告用户Silverlight项目会出现安全风险,并提供了两种项目模式.其次,Visual Studio 2010更加讲求团队精神. 开发更具有强大功能与简洁的 ...
最新文章
- 【IntelliJ IDEA】从资源文件读取出来就中文乱码的解决方法
- 2020癌症大数据分析,哪些癌症最要命?
- 使用百度地图API制作线路轨迹播放
- Eclipse Alt+/ Content Assistant
- 关于“using namespace std”
- java获取文件大小_Java中获取文件大小的详解及实例代码
- acm用java怎么写_用java来写ACM
- ADO Entities Framework不对多表查询进行优化?
- MYSQL 最大连接数设置
- ZigBee协议栈的串口实验
- Solidity 系列教程
- 上方用计算机英文,教你Win10计算器应用变成英文的解决方法
- 天气变冷了,用Python给爸妈制作一个天气提醒小助手
- 去掉CAJViewer广告的方法
- AttributeError: module 'tensorflow' has no attribute 'Session'错误解决
- JMeter Sampler之BeanShellSampler的使用
- YesPlayMusic 0.4.0中文版:一款mac用户必备的网易云音乐客户端
- TS学习(尚硅谷总结)
- 从零开始速通百度云网盘
- SpringBoot+Vue项目漫画网站