{!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} Namespace UnityEngine.TestTools.Constraints | Test Framework | 2.0.1-exp.2
docs.unity3d.com
"{0}"의 검색 결과

    목차 표시/숨기기

    Namespace UnityEngine.TestTools.Constraints

    클래스

    AllocatingGCMemoryConstraint

    An NUnit test constraint class to test whether a given block of code makes any GC allocations.

    Use this class with NUnit's Assert.That() method to make assertions about the GC behaviour of your code. The constraint executes the delegate you provide, and checks if it has caused any GC memory to be allocated. If any GC memory was allocated, the constraint passes; otherwise, the constraint fails.

    Be careful to take into account that there may be GC allocations that happen only on the first time your code is run, such as initialization of static variables. If you want to measure a 'typical' execution of your code, you may want to deliberately execute it once before testing it with this constraint, so that any one-time allocations have already been performed before this constraint measures it.

    Usually you negate this constraint to make sure that your delegate does not allocate any GC memory. This is easy to do using the Is class:

    ConstraintExtensions

    Is

    NUnit allows you to write test assertions in a more descriptive and human readable way using the Assert.That mechanism, where the first parameter is an object under test and the second parameter describes conditions that the object has to meet.

    We have extended NUnit API with a custom constraint type and declared an overlay Is class. To resolve ambiguity between the original implementation and the custom one you must explicitly declare it with a using statement or via addressing through the full type name UnityEngine.TestTools.Constraints.Is.

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