Ale*_*lex 14 aop nunit unit-testing postsharp
我想知道最好的方法是什么...我有兴趣将PostSharp引入我的一个项目中,但我不确定如何正确地测试标记有属性的类.
例如:
public class hello {
[MyAspectThatDoesSomethingToTheDatabaseWhenThisMethodGetsCalled]
public int omg(string lol) {
//fancy logic in here
}
}
Run Code Online (Sandbox Code Playgroud)
我想测试omg()方法中的逻辑,但是在单元测试中我需要确保不会调用方面,因为实际上没有数据库.
思考?