From c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 19 Apr 2020 17:19:32 -0400 Subject: Inital commit --- .../reference-attribute-unityplatform.md | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-attribute-unityplatform.md (limited to 'Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-attribute-unityplatform.md') diff --git a/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-attribute-unityplatform.md b/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-attribute-unityplatform.md new file mode 100644 index 0000000..4e08d1d --- /dev/null +++ b/Library/PackageCache/com.unity.test-framework@1.1.11/Documentation~/reference-attribute-unityplatform.md @@ -0,0 +1,35 @@ +# UnityPlatform attribute + +Use this attribute to define a specific set of platforms you want or do not want your test(s) to run on. + +You can use this attribute on the test method, test class, or test assembly level. Use the supported [RuntimePlatform](https://docs.unity3d.com/ScriptReference/RuntimePlatform.html) enumeration values to specify the platforms. You can also specify which platforms to test by passing one or more `RuntimePlatform` values along with or without the include or exclude properties as parameters to the [Platform](https://github.com/nunit/docs/wiki/Platform-Attribute) attribute constructor. + +The test(s) skips if the current target platform is: + +- Not explicitly specified in the included platforms list +- In the excluded platforms list + +```c# +using UnityEngine; +using UnityEngine.TestTools; +using NUnit.Framework; + +[TestFixture] +public class TestClass +{ + [Test] + [UnityPlatform(RuntimePlatform.WindowsPlayer)] + public void TestMethod() + { + Assert.AreEqual(Application.platform, RuntimePlatform.WindowsPlayer); + } +} +``` + +## Properties + +| Syntax | Description | +| --------------------------- | ------------------------------------------------------------ | +| `RuntimePlatform[] exclude` | List the platforms you do not want to have your tests run on. | +| `RuntimePlatform[] include` | A subset of platforms you need to have your tests run on. | + -- cgit v1.2.3