logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SteamIconPngEncoderTests

    EditMode tests for SteamIconPngEncoder. Every sprite is built in memory via Sprite.Create over a fresh Texture2D rather than imported as an asset — the encoder blits through a UnityEngine.RenderTexture rather than reading the source texture directly, so it never needs the source to be Read/Write enabled or to exist on disk. Pixel assertions allow a small tolerance because the value crosses a GPU blit, which a byte-for-byte assertion would make brittle to color-space settings.

    Inheritance
    object
    SteamIconPngEncoderTests
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.UnityAchievements.Tests.Editor
    Assembly: Tests.Editor.dll
    Syntax
    public class SteamIconPngEncoderTests
    Remarks

    The tests that assert on actual blitted pixel values are skipped when Serenity.UnityAchievements.Tests.Editor.SteamIconPngEncoderTests.RendersFrames is false — this project's own self-hosted CI runs EditMode with -nographics (GraphicsDeviceType.Null), under which UnityEngine.Graphics.Blit(UnityEngine.Texture,UnityEngine.RenderTexture) never samples the source texture and every readback comes back as the same placeholder value regardless of input. Same discipline as UnityAchievementScreenshotCapturerTests.RendersFrames: size/shape/ no-icon assertions that do not depend on a real GPU still run everywhere.

    Constructors

    SteamIconPngEncoderTests()

    Declaration
    public SteamIconPngEncoderTests()

    Methods

    EncodeLocked_ExplicitOverride_UsesTheOverrideSpriteInsteadOfGrayscaling()

    Declaration
    public void EncodeLocked_ExplicitOverride_UsesTheOverrideSpriteInsteadOfGrayscaling()

    EncodeLocked_NoExplicitOverride_GraysOutTheAchievementsOwnIcon()

    Declaration
    public void EncodeLocked_NoExplicitOverride_GraysOutTheAchievementsOwnIcon()

    EncodeUnlocked_AnyInputSize_OutputsExactlySixtyFourBySixtyFour()

    Declaration
    public void EncodeUnlocked_AnyInputSize_OutputsExactlySixtyFourBySixtyFour()

    EncodeUnlocked_DifferentSourceIcons_ProduceDifferentContentHashes()

    Declaration
    public void EncodeUnlocked_DifferentSourceIcons_ProduceDifferentContentHashes()

    EncodeUnlocked_NoIcon_ReturnsNone()

    Declaration
    public void EncodeUnlocked_NoIcon_ReturnsNone()

    EncodeUnlocked_SameSourceIcon_ProducesAStableContentHash()

    Declaration
    public void EncodeUnlocked_SameSourceIcon_ProducesAStableContentHash()

    TearDown()

    Declaration
    public void TearDown()
    In this article
    © 2026 Serenity. All Rights Reserved