Class WizardDraftReloadSimulator
Drives a wizard window through the messages Unity fires around a domain reload — OnDisable, the
reload itself in its harshest shape, then OnEnable — so a test proves what the window's OWN
messages do rather than restating them through a per-window seam. Shared by the contract that sweeps
every stepped wizard and by the per-window tests that pin one window's own drafts.
Inherited Members
Namespace: Serenity.Tests.Shared.Editor
Assembly: Serenity.Tests.Shared.Editor.dll
Syntax
public static class WizardDraftReloadSimulator
Methods
HoldersOf(EditorWindow)
Every Serenity.Global.Infrastructure.Editor.ISerenityWizardDraftHolder the window declares as a field, including ones inherited from a base window.
Declaration
public static List<ISerenityWizardDraftHolder> HoldersOf(EditorWindow window)
Parameters
| Type | Name | Description |
|---|---|---|
| EditorWindow | window |
Returns
| Type | Description |
|---|---|
| List<ISerenityWizardDraftHolder> |
InvokeWindowMessage(EditorWindow, Type, string)
Calls one of the window's own Unity messages by name, or does nothing when it declares none — a window with no drafts to keep needs neither.
Declaration
public static void InvokeWindowMessage(EditorWindow window, Type windowType, string messageName)
Parameters
| Type | Name | Description |
|---|---|---|
| EditorWindow | window | |
| Type | windowType | |
| string | messageName |
PrepareFrame(EditorWindow)
Runs the window's non-drawing frame preamble — safe outside a repaint — which is where a window that builds or restores its drafts lazily does so.
Declaration
public static void PrepareFrame(EditorWindow window)
Parameters
| Type | Name | Description |
|---|---|---|
| EditorWindow | window |
ReloadLosingScratch(EditorWindow)
OnDisable, then every draft holder the window declares loses both its non-serialized wrapper
and its scratch instances (see
Serenity.Global.Infrastructure.Editor.ISerenityWizardDraftHolder.SimulateScratchLosingDomainReloadForTests), then
OnEnable. A window that keeps its drafts outside a holder has nothing the simulated reload can
preserve for it, which is exactly what such a window loses to a real one.
Declaration
public static void ReloadLosingScratch(EditorWindow window)
Parameters
| Type | Name | Description |
|---|---|---|
| EditorWindow | window |