docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Assert

    The intent of this class is to provide debug assert utilities that don't rely on UnityEngine, for compatibility with code that needs to run in the DOTS Runtime environment. The current implement just wraps the equivalent Assert calls.

    Inheritance
    object
    Assert
    Namespace: Unity.Assertions
    Assembly: solution.dll
    Syntax
    public static class Assert

    Methods

    Name Description
    AreApproximatelyEqual(float, float)

    Assert that two float expressions are approximately equal to each other, within a default tolerance. Throws an exception if the assertion fails.

    AreApproximatelyEqual(float, float, float)

    Assert that two float expressions are approximately equal to each other, within a caller-provided tolerance. Throws an exception if the assertion fails.

    AreApproximatelyEqual(float, float, string)

    Assert that two float expressions are approximately equal to each other, within a default tolerance. Throws an exception if the assertion fails.

    AreEqual(bool, bool)

    Assert that two boolean values are equal to each other. Throws an exception if the assertion fails.

    AreEqual(int, int)

    Assert that two 32-bit integer values are equal to each other. Throws an exception if the assertion fails.

    AreEqual(IntPtr, IntPtr)

    Assert that two IntPtr values are equal to each other. Throws an exception if the assertion fails.

    AreEqual(Type, Type)

    Assert that two boolean values are not equal to each other. Throws an exception if the assertion fails.

    AreEqual<T>(T, T)

    Assert that two values are exactly equal to each other, according to their type's definition of equality. Throws an exception if the assertion fails.

    AreEqual<T>(T, T, string)

    Assert that two values are exactly equal to each other, according to their type's definition of equality. Throws an exception if the assertion fails.

    AreNotEqual(bool, bool)

    Assert that two IntPtr values are not equal to each other. Throws an exception if the assertion fails.

    AreNotEqual(int, int)

    Assert that two 32-bit integer values are not equal to each other. Throws an exception if the assertion fails.

    AreNotEqual<T>(T, T)

    Assert that two values are not equal to each other, according to their type's definition of equality. Throws an exception if the assertion fails.

    AreNotEqual<T>(T, T, string)

    Assert that two values are not equal to each other, according to their type's definition of equality. Throws an exception if the assertion fails.

    IsFalse(bool)

    Assert that a condition must be false. Throws an exception if the assertion fails.

    IsFalse(bool, string)

    Assert that a condition must be false. Throws an exception if the assertion fails.

    IsNotNull<T>(T)

    Assert that a value is not a null reference. Throws an exception if the assertion fails.

    IsNotNull<T>(T, string)

    Assert that a value is not a null reference. Throws an exception if the assertion fails.

    IsNull<T>(T)

    Assert that a value is a null reference. Throws an exception if the assertion fails.

    IsNull<T>(T, string)

    Assert that a value is a null reference. Throws an exception if the assertion fails.

    IsTrue(bool)

    Assert that a condition must be true. Throws an exception if the assertion fails.

    IsTrue(bool, string)

    Assert that a condition must be true. Throws an exception if the assertion fails.

    In This Article
    • Methods
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)