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(十六)的更多相关文章

  1. Gradle 1.12 翻译——第十六章. 使用文件

    有关其它已翻译的章节请关注Github上的项目:https://github.com/msdx/gradledoc/tree/1.12,或訪问:http://gradledoc.qiniudn.com ...

  2. Gradle 1.12用户指南翻译——第二十六章. War 插件

    其他章节的翻译请参见: http://blog.csdn.net/column/details/gradle-translation.html 翻译项目请关注Github上的地址: https://g ...

  3. Gradle 1.12用户指南翻译——第三十六章. Sonar Runner 插件

    本文由CSDN博客万一博主翻译,其他章节的翻译请参见: http://blog.csdn.net/column/details/gradle-translation.html 翻译项目请关注Githu ...

  4. linux基础-第十六单元 yum管理RPM包

    第十六单元 yum管理RPM包 yum的功能 本地yum配置 光盘挂载和镜像挂载 本地yum配置 网络yum配置 网络yum配置 Yum命令的使用 使用yum安装软件 使用yum删除软件 安装组件 删 ...

  5. NeHe OpenGL教程 第四十六课:全屏反走样

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...

  6. NeHe OpenGL教程 第三十六课:从渲染到纹理

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...

  7. NeHe OpenGL教程 第二十六课:反射

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...

  8. NeHe OpenGL教程 第十六课:雾

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...

  9. 【Visual C++】游戏开发五十六 浅墨DirectX教程二十三 打造游戏GUI界面(一)

    本系列文章由zhmxy555(毛星云)编写,转载请注明出处. 文章链接:http://blog.csdn.net/poem_qianmo/article/details/16384009 作者:毛星云 ...

随机推荐

  1. tf.cast()

    一.函数 tf.cast() cast( x, dtype, name=None ) 将x的数据格式转化成dtype.例如,原来x的数据格式是bool, 那么将其转化成float以后,就能够将其转化成 ...

  2. 87. Scramble String (String; DP)

    Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrin ...

  3. 转)Ubuntu14安装wireshark进行抓包

    转自:http://jingyan.baidu.com/article/c74d60009d992f0f6a595de6.html 背景: ubuntu14.04/64位 为了抓包和分析包 安装过程: ...

  4. iOS 网络请求中的空类型字符串转换

    创建一个工具类,   .h: #import <Foundation/Foundation.h> @interface MySetNullWithStrTool : NSObject +( ...

  5. discuz回贴通知插件实现-用户状态设置

    1.获取用户提交数据 discuz通过$_GET来获取全部数据,包括($_GET,$_POST). else if($_GET['pluginop'] == 'set') { //获取用户提交数据 $ ...

  6. C#集合类型大盘点(转载)

    原文地址:http://www.cnblogs.com/jesse2013/p/CollectionsInCSharp.html#b02

  7. SpringBoot集成篇(二) 异步调用Async

    什么是异步调用? 异步调用是相对于同步调用而言的,同步调用是指程序按预定顺序一步步执行,每一步必须等到上一步执行完后才能执行,异步调用则无需等待上一步程序执行完即可执行. 如何实现异步调用? 多线程, ...

  8. pyspider示例代码四:搜索引擎爬取

    搜索引擎爬取 #!/usr/bin/env python # -*- encoding: utf- -*- # Created on -- :: # Project: __git_lab_fix fr ...

  9. mysql数据库中如何查询日期在两个时间之间的关系

    select * from banner where addDate between '2017-06-04' and '2017-06-06';

  10. idea开发工具下报Set language level to 6-@Override in interfaces的解决方法

    idea开发工具下报Set language level to 6-@Override in interfaces的解决方法 实现接口时报如下错误:Set language level to 6-@O ...