logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class WizardDraftReloadContractTests

    The reload half of UpdateInPlaceRoundTripContract's "tools are management tools" rule: an edit the author has made but not yet confirmed must still be there after a script recompile. Every stepped wizard is covered automatically — the contract finds each window's scratch-draft holders by Serenity.Global.Infrastructure.Editor.ISerenityWizardDraftHolder rather than a registration list a new wizard can be written without.

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

    Drives the window's OWN OnDisable/OnEnable — the messages Unity fires around a real reload — rather than a per-window test seam that would re-state what they are supposed to do, so a window that disposes its holder from OnDisable (destroying the scratch and clearing the mirror while the reload is still pending) fails here instead of silently discarding the author's work. The reload itself is simulated in its harshest shape: see Serenity.Global.Infrastructure.Editor.ISerenityWizardDraftHolder.SimulateScratchLosingDomainReloadForTests.

    Constructors

    WizardDraftReloadContractTests()

    Declaration
    public WizardDraftReloadContractTests()

    Methods

    ACreateModeDraft_KeepsItsHalfFilledFormAndStaysACreateAcrossADomainReloadThatLosesTheScratch()

    The CREATE half of the same rule, stated on its own because the sweep above exercises whichever mode each window happens to resolve into, and a project full of assets resolves most of them into an update. A half-filled new form has nothing on disk to re-seed from, so losing its scratch is the one case where the captured state is the author's only copy — and coming back as an UPDATE of some asset would be worse than losing the edits, since the next confirm would overwrite that asset.

    Declaration
    public void ACreateModeDraft_KeepsItsHalfFilledFormAndStaysACreateAcrossADomainReloadThatLosesTheScratch()

    EveryWizardDraftHolder_KeepsAnUnsavedEditAcrossADomainReloadThatLosesTheScratch()

    Declaration
    public void EveryWizardDraftHolder_KeepsAnUnsavedEditAcrossADomainReloadThatLosesTheScratch()

    TearDown()

    Unity resets UnityEngine.TestTools.LogAssert.ignoreFailingMessages per log scope, so the flag this test sets in its own body has to be cleared here rather than leaked into whichever fixture runs next.

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