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. 上传文件到linux系统方法

    linux,windows filezilla 方法/步骤     下载 Filezilla client工具,此客户端为免费软件,下载完成后安装,安装一路下一步在这里就不过多阐述了,下载地址 htt ...

  2. 基于 CC2530 的温度采集系统(未定稿)

    前言 最近在自学 Zigbee,每天的主要是任务是:看博客,看 CC2530 的 datasheet 和实践,熟悉片上的 SFR 以及控制板子. 学和做内容包括:IO.外部中断.Timer1/3/4. ...

  3. php xss 函数

    function xss($string) { if (is_array($string)||is_object($string)||is_resource($string)) { return '' ...

  4. window phone 8 开发准备工作(一)

    一.下载安装Window phone SDK 1.Windows Phone SDK 8.0下载 http://www.microsoft.com/ZH-CN/download/details.asp ...

  5. 通用功能类:改变WinForm窗体显示颜色

    一.显示窗体调用方法 protected override void OnLoad(EventArgs e)        {            MDIClientSupport.SetBevel ...

  6. 作业07之《MVC模式》

    MVC(Model View Controller)模型-视图-控制器 MVC与模板概念的理解 MVC本来是存在于Desktop程序中的,M是指数据模型,V是指用户界面,C则是控制器.使用MVC的目的 ...

  7. Jenkins 定时 构建项目

    选择要定时构建的 项目-->配置-->构建触发器 触发项目: Poll SCM:定时检查源码变更(根据SCM软件的版本号),如果有更新就checkout最新code下来,然后执行构建动作. ...

  8. LOJ #6041. 「雅礼集训 2017 Day7」事情的相似度 LCT+SAM+线段树

    Code: #include<bits/stdc++.h> #define maxn 200003 using namespace std; void setIO(string s) { ...

  9. Sql Server 查询性能查看

    dbcc dropcleanbuffers --清除buffer pool里的数据页面 dbcc freeproccache --清除memtoleave和buffer pool里的执行计划内存 se ...

  10. 10.3 .NET 3.5 中的扩展方法

    10.3.4 用 Select 方法和匿名类型进行投影 class Program { static void Main(string[] args) { , ).Where(x => x % ...