我有一些为MsTest编写的集成测试。集成测试具有以下结构:通过在OpenCover中调用函数来过滤代码覆盖率
[TestClass]
public class When_Doing_Some_Stuff
{
[TestInitialize]
protected override void TestInitialize()
{
// create the Integration Test Context
EstablishContext();
// trigger the Integration Test
When();
}
protected void EstablishContext()
{
// call services to set up context
}
protected override void When()
{
// call service method to be tested
}
[TestMethod]
public void Then_Result_Is_Correct()
{
// assert against the result
}
}
我需要谁喊它来过滤函数的代码覆盖率结果。也就是说,我希望只有在函数是从名为“When”的函数调用的函数或应用了某个特定属性的函数时才会考虑覆盖率。
现在,即使在系统中某方法被调用在一些测试中的EstablishContext部分,该方法为访问标记。
我相信是有这个没有过滤器,我想作出改变自己,因为OpenCover是...好..开放。但我真的不知道从哪里开始。任何人都可以将我指向正确的方向吗?
你决定实现这个功能吗? – 2012-01-06 00:30:09