logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityAchievementScreenshotCapturerTests

    PlayMode tests for UnityAchievementScreenshotCapturer: that a capture yields PNG bytes no wider than the configured maximum, that requests made in the same frame share one readback, and that a torn-down capturer answers its pending requests instead of leaving the unlock path awaiting forever.

    Inheritance
    object
    UnityAchievementScreenshotCapturerTests
    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.Infrastructure
    Assembly: Tests.dll
    Syntax
    public class UnityAchievementScreenshotCapturerTests
    Remarks

    CI caveat, measured rather than assumed: a batch-mode run presents no frames, with or without a graphics device, and WaitForEndOfFrame never resumes there — a first cut of this suite hung two tests for their whole frame budget against a real D3D device under -batchmode. So every automated run of this file takes the "capture unavailable" branch, and the pixels are only asserted where a frame really was presented — an editor run, or a player.

    Every test therefore asserts the contract that holds either way: no exception, and a pending request always answered. That is the honest shape for a test whose subject is the display.

    Constructors

    UnityAchievementScreenshotCapturerTests()

    Declaration
    public UnityAchievementScreenshotCapturerTests()

    Methods

    Create_CarriesTheConfiguredMaximumWidth()

    Declaration
    public void Create_CarriesTheConfiguredMaximumWidth()

    Create_TheConfiguredWidthIsTheOneTheResampleDecisionUses()

    Declaration
    public void Create_TheConfiguredWidthIsTheOneTheResampleDecisionUses()

    Create_Twice_LeavesExactlyOneCapturerHost()

    Declaration
    public void Create_Twice_LeavesExactlyOneCapturerHost()

    EnqueueCapture_EndOfFrameNeverArrives_IsAbandonedRatherThanLeftPending()

    Declaration
    public IEnumerator EnqueueCapture_EndOfFrameNeverArrives_IsAbandonedRatherThanLeftPending()
    Returns
    Type Description
    IEnumerator

    IsEnabled_BatchModeRun_ReportsUnavailableEvenWithAGraphicsDevice()

    Declaration
    public void IsEnabled_BatchModeRun_ReportsUnavailableEvenWithAGraphicsDevice()

    IsEnabled_InPlayMode_FollowsWhetherTheBuildRendersFrames()

    Declaration
    public void IsEnabled_InPlayMode_FollowsWhetherTheBuildRendersFrames()

    IsEnabled_InteractiveRunWithAGraphicsDevice_ReportsAvailable()

    Declaration
    public void IsEnabled_InteractiveRunWithAGraphicsDevice_ReportsAvailable()

    IsEnabled_NoGraphicsDevice_ReportsUnavailable()

    Declaration
    public void IsEnabled_NoGraphicsDevice_ReportsUnavailable()

    TearDown()

    Declaration
    public void TearDown()

    TryCaptureAsync_AlreadyCancelled_AnswersWithNoBytesWithoutQueueing()

    Declaration
    public void TryCaptureAsync_AlreadyCancelled_AnswersWithNoBytesWithoutQueueing()

    TryCaptureAsync_CancelledWhileWaiting_AnswersWithNoBytes()

    Declaration
    public IEnumerator TryCaptureAsync_CancelledWhileWaiting_AnswersWithNoBytes()
    Returns
    Type Description
    IEnumerator

    TryCaptureAsync_CapturerDestroyedWhileWaiting_AnswersWithNoBytes()

    Declaration
    public IEnumerator TryCaptureAsync_CapturerDestroyedWhileWaiting_AnswersWithNoBytes()
    Returns
    Type Description
    IEnumerator

    TryCaptureAsync_ResolvesToPngBytesNoWiderThanTheConfiguredMaximum()

    Declaration
    public IEnumerator TryCaptureAsync_ResolvesToPngBytesNoWiderThanTheConfiguredMaximum()
    Returns
    Type Description
    IEnumerator

    TryCaptureAsync_TwoRequestsInTheSameFrame_ShareOneReadback()

    Declaration
    public IEnumerator TryCaptureAsync_TwoRequestsInTheSameFrame_ShareOneReadback()
    Returns
    Type Description
    IEnumerator
    In this article
    © 2026 Serenity. All Rights Reserved