docs.unity.cn
    Show / Hide Table of Contents

    Method AreNotEqual

    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.

    Declaration
    [Conditional("UNITY_ASSERTIONS")]
    public static void AreNotEqual<T>(T expected, T actual)
        where T : IEquatable<T>
    Parameters
    Type Name Description
    T expected

    The expected value.

    T actual

    The actual value.

    Type Parameters
    Name Description
    T

    The type of the values to test.

    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.

    Declaration
    [Conditional("UNITY_ASSERTIONS")]
    public static void AreNotEqual<T>(T expected, T actual, string message)
        where T : IEquatable<T>
    Parameters
    Type Name Description
    T expected

    The expected value.

    T actual

    The actual value.

    String message

    If the assertion fails, this message will be logged.

    Type Parameters
    Name Description
    T

    The type of the values to test.

    AreNotEqual(Int32, Int32)

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

    Declaration
    [Conditional("UNITY_ASSERTIONS")]
    public static void AreNotEqual(int expected, int actual)
    Parameters
    Type Name Description
    Int32 expected

    The expected value.

    Int32 actual

    The actual value.

    AreNotEqual(Boolean, Boolean)

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

    Declaration
    [Conditional("UNITY_ASSERTIONS")]
    public static void AreNotEqual(bool expected, bool actual)
    Parameters
    Type Name Description
    Boolean expected

    The expected value.

    Boolean actual

    The actual value.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023