开发者

MSTest Timeout attribute not working as expected

Why can't i use const values in timeout attribute, example:

private const int TIME_OUT = 1000;

[TesMethod]
[Timeout(2 * TIME_OUT)]
public void testA(){
  while(true);
}

Editing after comments:

It compiles but never stops in "timeout seco开发者_StackOverflow社区nds"


It's a bug in Visual Studio 2008 and this bug was fixed in VS2010


Are you running the test under the debugger? If so, then timeouts are disabled when under the debugger. Running from VS (not under debugger) or commandline should have timeouts enabled.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜