【发布时间】:2011-01-15 10:48:04
【问题描述】:
我想知道最好的方法是什么...我有兴趣将 PostSharp 引入我的一个项目,但我不确定如何正确地对标有属性的类进行单元测试。
例如:
public class hello {
[MyAspectThatDoesSomethingToTheDatabaseWhenThisMethodGetsCalled]
public int omg(string lol) {
//fancy logic in here
}
}
我想测试 omg() 方法中的逻辑,但在单元测试中我需要确保不会调用方面,因为实际上并没有数据库。
想法?
【问题讨论】:
标签: unit-testing nunit aop postsharp