https://github.com/nunit/docs/wiki/Console-Command-Line

The console interface runner is invoked by a command in the form

  1. NUNIT3-CONSOLE [inputfiles] [options]

where inputfiles is one or more assemblies or test projects of a type that NUnit can process and options is zero or more options.

Input files and options may be mixed in any order.

--where=EXPRESSION

An expression indicating which tests to run.

It may specify test names, classes, methods, categories or properties comparing them to actual values with the operators ==, !=, =~ and !~.

See Test Selection Language for a full description of the syntax.

https://github.com/nunit/docs/wiki/Test-Selection-Language

cat - A category assigned to the test, e.g. SmokeTests

Filtering Based on Properties

Although the syntax will accept any property name - including names that don't actually exist - filtering will only work on existing, string-valued properties. The following properties are created by NUnit and have string values:

  • Author
  • Category
  • Description
  • SetCulture
  • SetUICulture
  • TestOf
  • IgnoreUntilDate

In general, these properties were not created with filtering in mind, but you can use them if it suits your needs. Using the Category property currently accomplishes the same thing as the cat keyword. You should be aware that the use of these properties by NUnit is considered an implementation detail and they may change in the future.

We envision that most filtering by property will be based on user-defined properties, created for this purpose by inheriting from Property Attribute. When defining a property, you should keep the limitation to string values in mind. For example, a PriorityAttribute taking values of "High", "Medium" and "Low" could be used for filtering, while one that took the integers 1, 2 and 3 could not.

https://github.com/nunit/docs/wiki/Property-Attribute

Usage Note

The PropertyAttribute is not currently used for any purpose by NUnit itself, other than to display them in the XML output file and in the Test Properties dialog of the gui. You may also use use properties with the --where option on the command-line in order to select tests to run. See Test Selection Language. Note that his filtering will only work for properties where the values have type string.

  1. namespace NUnit.Tests
  2. {
  3. using System;
  4. using NUnit.Framework;
  5.  
  6. [TestFixture, Property("Location", )]
  7. public class MathTests
  8. {
  9. [Test, Property("Severity", "Critical")]
  10. public void AdditionTest()
  11. { /* ... */ }
  12. }
  13. }

后台所对应的函数

  1. //
  2. // Summary:
  3. // Construct a PropertyAttribute with a name and string value
  4. //
  5. // Parameters:
  6. // propertyName:
  7. // The name of the property
  8. //
  9. // propertyValue:
  10. // The property value
  11. public PropertyAttribute(string propertyName, string propertyValue);
  12. //
  13. // Summary:
  14. // Construct a PropertyAttribute with a name and int value
  15. //
  16. // Parameters:
  17. // propertyName:
  18. // The name of the property
  19. //
  20. // propertyValue:
  21. // The property value
  22. public PropertyAttribute(string propertyName, int propertyValue);
  23. //
  24. // Summary:
  25. // Construct a PropertyAttribute with a name and double value
  26. //
  27. // Parameters:
  28. // propertyName:
  29. // The name of the property
  30. //
  31. // propertyValue:
  32. // The property value
  33. public PropertyAttribute(string propertyName, double propertyValue);

另外还可以继承PropertyAttribute,实现自定义的property attribute

NUnit Console Command Line的更多相关文章

  1. Chrome console & Command Line API

    Chrome console & Command Line API $ && $$ querySelector querySelectorAll Command Line AP ...

  2. linux & command line & console & logs

    linux & command line & console & logs how to get the logs form linux command console htt ...

  3. Chrome-Console( Command Line API Reference)

    来源于:https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference The Comma ...

  4. logoff remote desktop sessions via command line tools

    This trick I learned from my one of ex-college.  In Windows servers, only two remote desktop session ...

  5. MySQL 5.7 Command Line Client输入密码后闪退和windows下mysql忘记root密码的解决办法

    MySQL 5.7 Command Line Client输入密码后闪退的问题: 问题分析: 1.查看mysql command line client默认执行的一些参数.方法:开始->所有程序 ...

  6. Linux Command Line Basics

    Most of this note comes from the Beginning the Linux Command Line, Second Edition by Sander van Vugt ...

  7. Linux Command Line 解析

    Linux Command Line 解析 0 处理模型 Linux kernel的启动包括很多组件的初始化和相关配置,这些配置参数一般是通过command line进行配置的.在进行后续分析之前,先 ...

  8. Xcode 8.X Command Line Tools

    Summary Step 1. Upgrade Your System to macOS Sierra Step 2. Open the Terminal Application Step 3. Is ...

  9. Creating Node.js Command Line Utilities to Improve Your Workflow

    转自:https://developer.telerik.com/featured/creating-node-js-command-line-utilities-improve-workflow/ ...

随机推荐

  1. spring data jpa 、hibernate、jpa之间的关系

    引用:http://blog.csdn.net/u014421556/article/details/52635000 hibernate作为JPA的实现.   JPA规范与ORM框架之间的关系   ...

  2. 三星A3、A5、A7、G7、J5、J7、S6系列等新机型的部分手机解锁 ROOT刷机

    三星A3.A5.A7.G7.J5.J7.S6系列等新机型的部分手机,三星官方加了限制,需要解锁后才能刷机如果没有解锁,刷第三方recovery或者刷非官方原版固件,都会刷不进,手机跳转到提示界面,显示 ...

  3. jqurey事件 ready方法用法

    ready 在文档加载后激活函数 例: <html> <head> <script type="text/javascript" src=" ...

  4. 【PostgreSQL-9.6.3】表操作语句

    1.创建数据表 create table table_name ( 字段1 数据类型[列级别约束条件][默认值], 字段2 数据类型[列级别约束条件][默认值], 字段3 数据类型[列级别约束条件][ ...

  5. 使用cookies查询商品浏览记录

    经历了俩个星期,易买网项目如期完工,现在总结一下如何使用cookies实现浏览商品的历史记录. 第一步:创建商品实体类. 第二步:连接oracle数据库. 第三步:创建商品三层架构. 效果图: 在要显 ...

  6. 图像局部显著性—点特征(SIFT为例)

    基于古老的Marr视觉理论,视觉识别和场景重建的基础即第一阶段为局部显著性探测.探测到的主要特征为直觉上可刺激底层视觉的局部显著性--特征点.特征线.特征块. SalientDetection 已经好 ...

  7. 使用CImage类 显示图片

    在不适用openCv的一种时候,使用CImage显示图片数据,并且直接嵌入DC框中. 使用CImage 在pic控件里显示图片 void CMyCalLawsDlg::MyShowImage( CIm ...

  8. POJ_1061_扩展欧几里德

    青蛙的约会 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 107027   Accepted: 21321 Descript ...

  9. 重写servlet,可以获取不同的方法

    public class BaseServlet extends HttpServlet { @Override public void service(HttpServletRequest requ ...

  10. swift-导航栏添加自定义返回按钮

    //1.添加返回按钮 func addBackBtn(){ let leftBtn:UIBarButtonItem=UIBarButtonItem(title: "返回", sty ...