<tfoot id='AqCLF'></tfoot>
  1. <i id='AqCLF'><tr id='AqCLF'><dt id='AqCLF'><q id='AqCLF'><span id='AqCLF'><b id='AqCLF'><form id='AqCLF'><ins id='AqCLF'></ins><ul id='AqCLF'></ul><sub id='AqCLF'></sub></form><legend id='AqCLF'></legend><bdo id='AqCLF'><pre id='AqCLF'><center id='AqCLF'></center></pre></bdo></b><th id='AqCLF'></th></span></q></dt></tr></i><div id='AqCLF'><tfoot id='AqCLF'></tfoot><dl id='AqCLF'><fieldset id='AqCLF'></fieldset></dl></div>

    <small id='AqCLF'></small><noframes id='AqCLF'>

  2. <legend id='AqCLF'><style id='AqCLF'><dir id='AqCLF'><q id='AqCLF'></q></dir></style></legend>

      • <bdo id='AqCLF'></bdo><ul id='AqCLF'></ul>

      NUnit 测试运行顺序

      NUnit Test Run Order(NUnit 测试运行顺序)

        <tbody id='S8bpW'></tbody>
          <bdo id='S8bpW'></bdo><ul id='S8bpW'></ul>

              <tfoot id='S8bpW'></tfoot>

              <i id='S8bpW'><tr id='S8bpW'><dt id='S8bpW'><q id='S8bpW'><span id='S8bpW'><b id='S8bpW'><form id='S8bpW'><ins id='S8bpW'></ins><ul id='S8bpW'></ul><sub id='S8bpW'></sub></form><legend id='S8bpW'></legend><bdo id='S8bpW'><pre id='S8bpW'><center id='S8bpW'></center></pre></bdo></b><th id='S8bpW'></th></span></q></dt></tr></i><div id='S8bpW'><tfoot id='S8bpW'></tfoot><dl id='S8bpW'><fieldset id='S8bpW'></fieldset></dl></div>

                <small id='S8bpW'></small><noframes id='S8bpW'>

              1. <legend id='S8bpW'><style id='S8bpW'><dir id='S8bpW'><q id='S8bpW'></q></dir></style></legend>
                本文介绍了NUnit 测试运行顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                默认情况下,nunit 测试按字母顺序运行.有谁知道设置执行顺序的任何方法?是否存在此属性?

                By default nunit tests run alphabetically. Does anyone know of any way to set the execution order? Does an attribute exist for this?

                推荐答案

                每个单元测试都应该能够独立运行和独立运行.如果它们满足此标准,则顺序无关紧要.

                Your unit tests should each be able to run independently and stand alone. If they satisfy this criterion then the order does not matter.

                但在某些情况下,您需要先运行某些测试.一个典型的例子是在持续集成的情况下,一些测试比其他的运行时间更长.我们使用类别属性,以便我们可以在使用数据库的测试之前运行使用模拟的测试.

                There are occasions however where you will want to run certain tests first. A typical example is in a Continuous Integration situation where some tests are longer running than others. We use the category attribute so that we can run the tests which use mocking ahead of the tests which use the database.

                即把它放在你快速测试的开始

                i.e. put this at the start of your quick tests

                [Category("QuickTests")]
                

                如果您有依赖于特定环境条件的测试,请考虑 TestFixtureSetUpTestFixtureTearDown 属性,它们允许您标记要在测试之前和之后执行的方法.

                Where you have tests which are dependant on certain environmental conditions, consider the TestFixtureSetUp and TestFixtureTearDown attributes, which allow you to mark methods to be executed before and after your tests.

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

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Performance overhead of using attributes in .NET(在 .NET 中使用属性的性能开销)
                Accessing attribute info from DTE(从 DTE 访问属性信息)
                c# Hide a property in datagridview with datasource(c#使用数据源隐藏datagridview中的属性)
                Extract Display name and description Attribute from within a HTML helper(从 HTML 帮助器中提取显示名称和描述属性)
                How can I force the PropertyGrid to show a custom dialog for a specific property?(如何强制 PropertyGrid 显示特定属性的自定义对话框?)
                Associate attribute with code generated property in .net(将属性与 .net 中的代码生成属性相关联)

              2. <small id='EvLba'></small><noframes id='EvLba'>

                <legend id='EvLba'><style id='EvLba'><dir id='EvLba'><q id='EvLba'></q></dir></style></legend>
                    <tfoot id='EvLba'></tfoot>
                      <tbody id='EvLba'></tbody>

                      1. <i id='EvLba'><tr id='EvLba'><dt id='EvLba'><q id='EvLba'><span id='EvLba'><b id='EvLba'><form id='EvLba'><ins id='EvLba'></ins><ul id='EvLba'></ul><sub id='EvLba'></sub></form><legend id='EvLba'></legend><bdo id='EvLba'><pre id='EvLba'><center id='EvLba'></center></pre></bdo></b><th id='EvLba'></th></span></q></dt></tr></i><div id='EvLba'><tfoot id='EvLba'></tfoot><dl id='EvLba'><fieldset id='EvLba'></fieldset></dl></div>

                        • <bdo id='EvLba'></bdo><ul id='EvLba'></ul>