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

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

    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.

namespace NUnit.Tests
{
using System;
using NUnit.Framework; [TestFixture, Property("Location", )]
public class MathTests
{
[Test, Property("Severity", "Critical")]
public void AdditionTest()
{ /* ... */ }
}
}

后台所对应的函数

    //
// Summary:
// Construct a PropertyAttribute with a name and string value
//
// Parameters:
// propertyName:
// The name of the property
//
// propertyValue:
// The property value
public PropertyAttribute(string propertyName, string propertyValue);
//
// Summary:
// Construct a PropertyAttribute with a name and int value
//
// Parameters:
// propertyName:
// The name of the property
//
// propertyValue:
// The property value
public PropertyAttribute(string propertyName, int propertyValue);
//
// Summary:
// Construct a PropertyAttribute with a name and double value
//
// Parameters:
// propertyName:
// The name of the property
//
// propertyValue:
// The property value
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. nprogress进度条和ajax全局事件

    nprogress和ajax全局事件 nprogress 官方网站:http://ricostacruz.com/nprogress/ 下载地址:https://github.com/rstacruz ...

  2. os的进程调度算法(抄袭的)

    package me.letterwish.test; import java.io.BufferedInputStream; import java.io.FileInputStream; impo ...

  3. list用法(用到了再补充)

    之前学list吧,也知道很多,但是到用的时候却无从下手,还是不熟悉的缘故,看来基础知识应该再加强,要达到信手拈来的程度才行. 先说下list的特性:有序可重复,也可以存储多个空值. 我用到的方法: L ...

  4. Eigen与Matlab语法及语义辞典

    Eigen为Matlab转换为C++提供了一个简单的语法级别的代码迁移工具. 对一些代码进行了扩充,以便程序由Matlab到Eigen的移植................... 参考链接:http: ...

  5. LA 4327

    Panagola, The Lord of city F likes to parade very much. He always inspects his city in his car and e ...

  6. Es6获取数据

    $(function(){ $.ajax({ //请求方式 type:"GET", //文件位置 url:"js/data.json", //返回数据格式为js ...

  7. 转载:Java中的Checked Exception——美丽世界中潜藏的恶魔?

    转自 Amber-Garden 的 博客 https://www.cnblogs.com/loveis715/p/4596551.html 在使用Java编写应用的时候,我们常常需要通过第三方类库来帮 ...

  8. 08.Web服务器-4.Web服务器动态资源请求

    1 浏览器请求动态页面过程 2 WSGI 怎么在你刚建立的Web服务器上运行一个Django应用和Flask应用,如何不做任何改变而适应不同的web架构呢? 在以前,选择 Python web 架构会 ...

  9. 26.bulk批量操作

    主要知识点 1.bulk语法 2.bulk使用时的注意事项 3.bulk size 对es性能的影响     一.bulk语法 每一个操作要两个json串(delete操作除外),每个json串占一行 ...

  10. JAVA关键技术

    通用技术方面 MVC 1)概念 MVC是一个架构模式,它分离了表现与交互.它被分为三个核心部件:模型-model.视图-view.控制器-controller 2)工作原理 所有的终端用户请求被发送到 ...