docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ComparisonResultMessage

    A player-to-host message carrying the thresholds (expected) and measured values (actual) of a single image comparison, sent for every comparison whether it passed or failed.

    Inheritance
    object
    ComparisonResultMessage
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.TestTools.Graphics
    Assembly: UnityEngine.TestTools.Graphics.dll
    Syntax
    public class ComparisonResultMessage

    Properties

    ActualJson

    The measured values as a JSON object, with keys specific to Algorithm.

    Declaration
    public string ActualJson { get; set; }
    Property Value
    Type Description
    string

    Algorithm

    The type name of the TextureComparisonAlgorithm that produced the values.

    Declaration
    public string Algorithm { get; set; }
    Property Value
    Type Description
    string

    ExpectedJson

    The configured thresholds as a JSON object, with keys specific to Algorithm.

    Declaration
    public string ExpectedJson { get; set; }
    Property Value
    Type Description
    string

    ImageName

    The name identifying the compared image, if one was configured.

    Declaration
    public string ImageName { get; set; }
    Property Value
    Type Description
    string

    MessageId

    The message ID for the comparison result message. This is used to identify the message type.

    Declaration
    public static Guid MessageId { get; }
    Property Value
    Type Description
    Guid

    Success

    Whether the comparison passed its thresholds.

    Declaration
    public bool Success { get; set; }
    Property Value
    Type Description
    bool

    TestName

    The full name of the NUnit test the comparison ran in, or null when the comparison ran outside a test.

    Declaration
    public string TestName { get; set; }
    Property Value
    Type Description
    string

    Methods

    Deserialize(byte[])

    Deserializes a byte array produced by Serialize().

    Declaration
    public static ComparisonResultMessage Deserialize(byte[] data)
    Parameters
    Type Name Description
    byte[] data

    The serialized byte array.

    Returns
    Type Description
    ComparisonResultMessage

    The deserialized message.

    Serialize()

    Serializes the message to a byte array.

    Declaration
    public byte[] Serialize()
    Returns
    Type Description
    byte[]

    The serialized byte array representation of the message.

    In This Article
    Back to top
    Copyright © 2026 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)