Nunit 测试执行顺序 [英] Nunit Tests order of Execution

查看:81
本文介绍了Nunit 测试执行顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于那些精通自动化的人来说,这似乎是一个愚蠢的问题,但我正在为很多事情而苦苦挣扎.这是一个:

This might seem a sily question to those who are well versed in autonmation but I am struggling with many things. Here's one:

我发现我在 Visual Studio 2008 中使用 Selenium RC 创建的测试是按照名称的字母顺序从 NUnit 运行的?

I am finding that the tests I created with Selenium RC in Visual Studio 2008 are getting run from NUnit in the alphabetical order of their names?

我错过了什么?有没有办法组织 Nunit 中测试的运行顺序?

What am I missing? Is there a way to organize the order in which the tests in Nunit are run?

谢谢!

推荐答案

从技术上讲,您的单元测试都应该能够彼此独立运行,因此顺序应该无关紧要.

Technically, your unit tests should all be able to run independently of each other so ordering should not matter.

我认为可能是时候重新考虑您的测试方式了.

I think it might be time to re-think how you are doing your tests.

如果您只是希望它们按特定顺序运行,因为这是您更喜欢"它们运行的​​方式,那么我认为您正在浪费宝贵的时间做一些真正不那么重要的事情.

If you just want them run in a specific order because that's how you "prefer" them to be run, then I would argue that you are throwing away precious time doing something that really isn't that important.

如果您需要在执行测试之前完成特定的工作,请查看 设置和拆卸方法.

If you need specific things done before the tests are executed, check out the setup and teardown methods.

这篇关于Nunit 测试执行顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆