我希望能够根据几个标准有选择地运行 NUnit 测试。就我而言,选择将基于:测试优先级和/或测试类型。
测试类/方法如下所示:
namespace NUnit.Tests
{
using System;
using NUnit.Framework;
[TestFixture]
public class MathTests
{
[Test, Property("Priority", "Critical"), Property("Type", "Fully automatic")]
public void AdditionTest()
{ /* ... */ }
[Test, Property("Priority", "High"), Property("Type", "Partly automatic")]
public void MultiplicationTest()
{ /* ... */ }
}
}
我只想运行具有“优先级”=“关键”和“类型”=“全自动”的测试。
是否可以使用 NUnit 实现这样的选择?我知道可以选择属于特定“类别”的测试来执行,但这只是一个标准......