运行单元测试时如何禁用PostSharp? [英] How do you disable PostSharp when running unit tests?

查看:110
本文介绍了运行单元测试时如何禁用PostSharp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的nunit测试不要应用任何PostSharp方面,以便我可以独立测试我的方法.可以在测试装置设置"中以某种方式完成此操作,还是只能在每个项目级别上完成此操作?

I want my nunit tests not to apply any of my PostSharp aspects so I can test my methods in isolation. Can this be done somehow in the Test Fixture Setup, or can it only be done on a per project level?

推荐答案

您可以在测试版本上设置'SkipPostSharp'标志,这样一来它就不会被编译到您的二进制文件中.

You could set the 'SkipPostSharp' flag on the test build, so that it is not compiled into your binaries in the first place.

这篇关于运行单元测试时如何禁用PostSharp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆