Version: 2017.2
public RuntimePlatform[] exclude ;

描述

排除的平台。

将测试列表设置为跳过使用 RuntimePlatform 枚举指定的平台。如果 include 属性不为空,则不排除任何测试。

using UnityEngine;
using UnityEngine.TestTools;
using NUnit.Framework;

[TestFixture] public class TestClass { [Test] [UnityPlatform(exclude = new[] {RuntimePlatform.WindowsEditor })] public void TestMethod() { Assert.AreNotEqual(Application.platform, RuntimePlatform.WindowsEditor); } }