[翻译]NUnit---RequiredAddin and RequiresMTA Attributes(十六)
RequiredAddinAttribute (NUnit 2.5)
RequiredAddin特性用于提示一个程序集需要特殊的插件才能保证功能正常。如果没有安装插件,整个程序集会被标记为未运行。
Note:在Alpha-3版本,这个特性可以运用于类或方法。但这是受限制的,主要有2个原因:
1、如由于遗漏了插件,那么这个方法或者类不被认可为一个测试,NUnit一直都不会处理它。
2、如果这个方法或者类又不同的插件处理,插件肯能无法识别这个特性
在下个版本中这个特性可能会被限制于程序集。
Example
[assembly: RequiredAddin("MyTestFixtureAddin")]
[assembly: RequiredAddin("MyTestAddin")]
[assembly: RequiredAddin("MyDecoratorAddin")]
...
namespace NUnit.Tests
{
using System;
using NUnit.Framework;
[MyTestFixture]
public class MyTests
{
[MyTest]
public void SomeTest()
{
...
}
}
[TestFixture, MyDecorator]
public class MoreTests
{
[Test, MyDecorator]
public void AnotherTest()
{
...
}
}
}
RequiresMTAAttribute (NUnit 2.5)
RequiresMTA特性可以应用与测试方法、类或者程序集,用于指定这些测试应该在多线程环境下运行。如果父类测试没有在多线程中运行那么它会创建一个新的进程。
Note:在测试方法你也可以使用RequiresMTA特性。尽管运行时只在执行程序集入口确认,许多用户希望在测试上工作,所以我们把它当作同义词。
Examples
// An MTA thread will be created and used to run
// all the tests in the assembly
[assembly:RequiresMTA] ... // TestFixture requiring a separate thread
[TestFixture, RequiresMTA]
public class FixtureRequiringMTA
{
// An MTA thread will be created and all
// tests in the fixture will run on it
// unless the containing assembly is
// already running on an MTA Thread
} [TestFixture]
public class AnotherFixture
{
[Test, RequiresMTA]
public void TestRequiringMTA()
{
// A separate thread will be created for this test
// unless the containing fixture is already running
// in the MTA.
}
}
See also...
- RequiresThreadAttribute
- RequiresSTAAttribute
[翻译]NUnit---RequiredAddin and RequiresMTA Attributes(十六)的更多相关文章
- Gradle 1.12 翻译——第十六章. 使用文件
有关其它已翻译的章节请关注Github上的项目:https://github.com/msdx/gradledoc/tree/1.12,或訪问:http://gradledoc.qiniudn.com ...
- Gradle 1.12用户指南翻译——第二十六章. War 插件
其他章节的翻译请参见: http://blog.csdn.net/column/details/gradle-translation.html 翻译项目请关注Github上的地址: https://g ...
- Gradle 1.12用户指南翻译——第三十六章. Sonar Runner 插件
本文由CSDN博客万一博主翻译,其他章节的翻译请参见: http://blog.csdn.net/column/details/gradle-translation.html 翻译项目请关注Githu ...
- linux基础-第十六单元 yum管理RPM包
第十六单元 yum管理RPM包 yum的功能 本地yum配置 光盘挂载和镜像挂载 本地yum配置 网络yum配置 网络yum配置 Yum命令的使用 使用yum安装软件 使用yum删除软件 安装组件 删 ...
- NeHe OpenGL教程 第四十六课:全屏反走样
转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...
- NeHe OpenGL教程 第三十六课:从渲染到纹理
转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...
- NeHe OpenGL教程 第二十六课:反射
转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...
- NeHe OpenGL教程 第十六课:雾
转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...
- 【Visual C++】游戏开发五十六 浅墨DirectX教程二十三 打造游戏GUI界面(一)
本系列文章由zhmxy555(毛星云)编写,转载请注明出处. 文章链接:http://blog.csdn.net/poem_qianmo/article/details/16384009 作者:毛星云 ...
随机推荐
- springmvc DispatchServlet初始化九大加载策略(三)
7. initRequestToViewNameTranslator 请求视图名 它主要与视图解析有关,如果对ViewResolvers.ModelAndView.View等没有多大印象,可以先看第8 ...
- javaWeb后端学习记录
java后端学习重点: 1.java语言特性: 基础知识,集合,多线程,并发,JVM,NIO,网络编程,设计模式. (★★★★★) jdk源码中有大量的数据结构与java语言细节.jdk源码着重看c ...
- string类小结
要想使用标准C++中string类,必须要包含 #include <string>// 注意是<string>,不是<string.h>,带.h的是C语言中的头文件 ...
- Python requests 使用心得
最近在用requests写一些项目,遇见了一些问题,百度了很多,有些都不太好使,最后看了下requestsAPI文档,才明白了很多,最后项目趋于稳定.看来学东西还是API文档比较权威啊~ 问题场景 项 ...
- iOS - OC - 网络请求 - 中文转码
#import "ViewController.h" @interface ViewController () @end @implementation ViewControlle ...
- ajax.beginform控制器中实体为null的问题
控制器: 函数声明:public JsonResult ApplyFun(Test test) 原因:在视图中有一个表单的name属性为test,因为冲突所导致.
- js如何切割字符串
<script language="javascript"> str="2,2,3,5,6,6"; //这是一字符串 var strs= new A ...
- [freeCodeCamp] solution to JUGGLING ASYNC
Here's the official solution in case you want to compare notes: var http = require('http') var bl = ...
- geoserver中除了使用kml来查询数据以外,还可以使用csql或ecsql
package com.geoserver; import java.io.IOException; import java.util.ArrayList; import java.util.Hash ...
- 设置powershell ExecutionPolicy
Get-ExecutionPolicy -List Set-ExecutionPolicy -Scope CurrentUser AllSigned Policies: Restricted/AllS ...