如何为多次迭代运行单元测试 [英] How to run unit tests for multiple iterations
本文介绍了如何为多次迭代运行单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI
我正在使用Microsoft Test框架编写单元测试。
I am using Microsoft Test framework to write my unit test.
如何为多次迭代运行我的测试,即无限循环?
How to i run my tests for multiple iterations i.e. in an infinite loop?
谢谢
Thakur
Thakur
推荐答案
嗨Thakur,
Hi Thakur,
请将循环内部的代码放在一个单独的函数中,并且单元测试没有循环的功能。
Please just put the code that is inside the loop in a separate function, and unit test that function without the loop.
也许
这个类似的主题和一些特定的样本可以给你一些提示。
Maybe this similar thread with some specific sample could give you some hints.
问候,
Fletcher
这篇关于如何为多次迭代运行单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文