Class RecipeShippedAssetFixture
A private project folder filled with copies of real shipped Serenity assets — menus whose options carry
action and GameSettings bindings, modals whose options carry submit signals, a feedback with an animation
curve, an audio player routed to a mixer group, a clip and a music track. A round trip over hand-made
minimal assets proves nothing about the content a real project exports, so the recipe round-trip tests
run over these copies and compare the files on disk byte for byte — every copy and its .meta — and the
project files outside the copies a run could plausibly write (the Addressables settings and groups, the
shipped localization tables), which must stay byte-identical too. The shipped "Global" String Table
Collection is copied under a name of its own (see RecipeStringTableCollectionCopy).
Inherited Members
Namespace: Serenity.ProjectRecipe.Tests.Editor
Assembly: Serenity.ProjectRecipe.Tests.Editor.dll
Syntax
public sealed class RecipeShippedAssetFixture
Constructors
RecipeShippedAssetFixture(string)
Creates a fixture over root; nothing is copied until CopyShippedAssets().
Declaration
public RecipeShippedAssetFixture(string root)
Parameters
| Type | Name | Description |
|---|---|---|
| string | root |
Fields
CopiedCollectionFolder
The folder the copied String Table Collection lives in, relative to the fixture root.
Declaration
public const string CopiedCollectionFolder = "Localization"
Field Value
| Type | Description |
|---|---|
| string |
CopiedCollectionName
The name the copied String Table Collection goes by, so no lookup by name meets the shipped one.
Declaration
public const string CopiedCollectionName = "RecipeFixtureGlobal"
Field Value
| Type | Description |
|---|---|
| string |
ExitApplicationModalRelativePath
The copied shipped exit-application modal, whose options carry several submit signals, relative to the fixture root.
Declaration
public const string ExitApplicationModalRelativePath = "Modal/Modals/ExitApplication/ExitApplicationModal.asset"
Field Value
| Type | Description |
|---|---|
| string |
FeedbackRelativePath
The copied shipped feedback, relative to the fixture root.
Declaration
public const string FeedbackRelativePath = "Feedback/StartGameFeedback/StartGameFeedback.asset"
Field Value
| Type | Description |
|---|---|
| string |
MainMenuRelativePath
The copied shipped main menu, relative to the fixture root.
Declaration
public const string MainMenuRelativePath = "Menu/Menus/MainMenu.asset"
Field Value
| Type | Description |
|---|---|
| string |
ShippedAssetsRelativeToMediaRoot
Shipped assets the fixture copies, relative to the package's media root.
Declaration
public static readonly string[] ShippedAssetsRelativeToMediaRoot
Field Value
| Type | Description |
|---|---|
| string[] |
Properties
CopiedCollectionRelativePath
The copied String Table Collection asset, relative to the fixture root.
Declaration
public static string CopiedCollectionRelativePath { get; }
Property Value
| Type | Description |
|---|---|
| string |
FullCopyExportedEntryCount
How many recipe entries an export of a full copy (CopyShippedAssets()) carries: one per copied asset and one for the copied String Table Collection.
Declaration
public static int FullCopyExportedEntryCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Root
The project folder the copies live in.
Declaration
public string Root { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
CopiedTableRelativePath(string)
The copied String Table Collection's table for localeCode, relative to the
fixture root.
Declaration
public static string CopiedTableRelativePath(string localeCode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | localeCode |
Returns
| Type | Description |
|---|---|
| string |
CopyShippedAssets()
Copies every shipped asset in ShippedAssetsRelativeToMediaRoot under Root at the same relative path and the shipped String Table Collection under CopiedCollectionFolder, then records every copied file's bytes.
Declaration
public void CopyShippedAssets()
CopyShippedAssets(IReadOnlyList<string>)
Copies the named shipped assets (paths relative to the package's media root) under Root at the same relative path, then records every copied file's bytes.
Declaration
public void CopyShippedAssets(IReadOnlyList<string> relativePaths)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<string> | relativePaths |
CopyShippedStringTableCollection()
Copies only the shipped String Table Collection under CopiedCollectionFolder, then records every copied file's bytes.
Declaration
public void CopyShippedStringTableCollection()
Delete()
Deletes Root and everything under it, and first any Addressables entry a run registered for a copy, so no entry is left pointing at a deleted asset.
Declaration
public void Delete()
ExportThroughJson(SerenityRecipeReport)
Exports Root through its JSON text (see ExportThroughJson(string, SerenityRecipeReport)).
Declaration
public SerenityRecipe ExportThroughJson(SerenityRecipeReport exportReport)
Parameters
| Type | Name | Description |
|---|---|---|
| SerenityRecipeReport | exportReport |
Returns
| Type | Description |
|---|---|
| SerenityRecipe |
FilesChangedSinceCopy()
The files under Root — copies and .meta files alike, the root's own
.meta included — whose bytes on disk differ from what the copy recorded, after flushing every pending
write.
Declaration
public List<string> FilesChangedSinceCopy()
Returns
| Type | Description |
|---|---|
| List<string> |
PathOf(string)
The project path of a copy, from its path relative to Root.
Declaration
public string PathOf(string relativePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | relativePath |
Returns
| Type | Description |
|---|---|
| string |
ProjectFilesOutsideTheRootChangedSinceCopy()
The project files outside Root a run could plausibly write (the Addressables data, the shipped localization tables) whose bytes differ from what the copy recorded.
Declaration
public List<string> ProjectFilesOutsideTheRootChangedSinceCopy()
Returns
| Type | Description |
|---|---|
| List<string> |