Class WizardDoneStepReloadSimulator
Simulates the domain reload a script-generating or asset-importing primary action can trigger on its
normal path, for a test proving a wizard's Done step still reads the run that just finished: a fresh
instance receives only what the window's serializer actually persists, so state the window keeps in a
non-serialized field comes back at its default, exactly as a real reload leaves it.
Inheritance
WizardDoneStepReloadSimulator
Assembly: Serenity.Tests.Shared.Editor.dll
Syntax
public static class WizardDoneStepReloadSimulator
Fields
LostRunMessage
The failure message every caller asserts with, so each window reports a lost run the
same way.
Declaration
public const string LostRunMessage = "The run this window just finished must still be readable after a domain reload, or its Done step reports that nothing was written above a still-populated activity log. Complete the primary action through CompletePrimaryAction and read PrimaryActionOutcome instead of a non-serialized copy of the creator's result."
Field Value
Methods
ReadAfterDomainReload<TWindow, TRun>(TWindow, Func<TWindow, TRun>)
Reads readRun off a reloaded copy of window, then
destroys the copy. Call it last in a test: the copy shares the original's scratch drafts, and
destroying it may dispose them.
Declaration
public static TRun ReadAfterDomainReload<TWindow, TRun>(TWindow window, Func<TWindow, TRun> readRun) where TWindow : ScriptableObject
Parameters
| Type |
Name |
Description |
| TWindow |
window |
|
| Func<TWindow, TRun> |
readRun |
|
Returns
Type Parameters
| Name |
Description |
| TWindow |
|
| TRun |
|
SerializedCopyOf<TWindow>(TWindow)
A fresh instance of window's own type holding only what its serialized
state carries. The caller destroys it.
Declaration
public static TWindow SerializedCopyOf<TWindow>(TWindow window) where TWindow : ScriptableObject
Parameters
| Type |
Name |
Description |
| TWindow |
window |
|
Returns
Type Parameters