{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Class UnityPlatformAttribute | Test Framework | 2.0.1-exp.2
docs.unity3d.com
"{0}"의 검색 결과

    목차 표시/숨기기

    Class UnityPlatformAttribute

    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 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 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
    상속
    object
    UnityPlatformAttribute
    구현
    IApplyToTest
    네임스페이스: UnityEngine.TestTools
    어셈블리: solution.dll
    구문
    [AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true)]
    public class UnityPlatformAttribute : NUnitAttribute, IApplyToTest
    예
    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);
        }
    }

    생성자

    이름 설명
    UnityPlatformAttribute()

    Constructs a new instance of the UnityPlatformAttribute class.

    UnityPlatformAttribute(params RuntimePlatform[])

    Constructs a new instance of the UnityPlatformAttribute class with a list of platforms to include.

    프로퍼티

    이름 설명
    exclude

    List the platforms you do not want to have your tests run on.

    include

    A subset of platforms you need to have your tests run on.

    메서드

    이름 설명
    ApplyToTest(Test)

    Modifies a test as defined for the specific attribute.

    문서 개요
    맨 위로
    Copyright © 2023 Unity Technologies — 상표 및 이용약관
    • 법률정보
    • 개인정보처리방침
    • 쿠키
    • 내 개인정보 판매 금지
    • Your Privacy Choices (Cookie Settings)