[翻译]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 作者:毛星云 ...
随机推荐
- spring jpa exists
Subquery<A> subquery = criteriaQuery.subquery(A.class);Root<A> root1 = subquery.from(A.c ...
- go语言中通过http访问需要认证的api
func main() { //生成client 参数为默认 client := &http.Client{} //生成要访问的url url := "https://api.XXX ...
- JAVA知识积累 给HttpClient添加Socks代理
本文描述http client使用socks代理过程中需要注意的几个方面:1,socks5支持用户密码授权:2,支持https:3,支持让代理服务器解析DNS: 使用代理创建Socket 从原理上来看 ...
- java web 常用正则
什么是 RegExp? RegExp 是正则表达式(Regular expression)的缩写,作用是对字符串执行模式匹配. 通常用于格式验证.正则替换.查找子串等 各种编程语言的正则表达式基本相同 ...
- [leetcode]636. Exclusive Time of Functions函数独占时间
Given the running logs of n functions that are executed in a nonpreemptive single threaded CPU, find ...
- count(distinct) 与group by 浅析
x在传统关系型数据库中,group by与count(distinct)都是很常见的操作.count(distinct colA)就是将colA中所有出现过的不同值取出来,相信只要接触过数据库的同学都 ...
- css浮动的元素居中
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- 绘制3D的js库
有哪些值得推荐的绘制3D的js库? 4 个回答 默认排序 草皮子 HTML5/GAME 4 人赞同了该回答 只用过three.js,所以推荐这个.不清楚你打算用来做什么,总的来说,得看你的运 ...
- OpenGL.ProjectiveTextureMapping
1. 简介 https://developer.nvidia.com/content/projective-texture-mapping
- 关于神奇的浮点型double变量
1.因为double类型都是1.xxxxxxxxx(若干个0和1,二进制)乘以2的若干次幂来表示一个数,所以,和十进制的小数势必不能够一一对应,因为位数有限,总要有一个精度(两个数之间的实数是任意多的 ...