Class AchievementSyncAssetTestBase
The private temp folder, the authored fixture assets and the Addressables clean-up every test that
applies a sync plan to real assets needs. Every fixture asset lives under a folder named after the
concrete test class, and creations pass RegisterAsAddressables = false, mirroring
AchievementDefinitionCreatorTests.
Inheritance
AchievementSyncAssetTestBase
Assembly: Tests.Editor.dll
Syntax
public abstract class AchievementSyncAssetTestBase
Constructors
AchievementSyncAssetTestBase()
Declaration
protected AchievementSyncAssetTestBase()
Properties
TempFolder
Declaration
protected string TempFolder { get; }
Property Value
| Type |
Description |
| string |
The project folder this test class keeps its fixture assets in.
|
Methods
AuthorAchievement(string, string)
Declaration
protected UnityAchievementDefinition AuthorAchievement(string achievementId, string folder)
Parameters
Returns
CountAddressableEntries()
Declaration
protected static int CountAddressableEntries()
Returns
CreateFolderRecursively(string)
Declaration
protected static void CreateFolderRecursively(string folder)
Parameters
| Type |
Name |
Description |
| string |
folder |
|
CreateFolderThenRemoveItFromDisk(string)
Leaves a folder the UnityEditor.AssetDatabase still believes in but that no longer exists on disk,
which is what makes UnityEditor.AssetDatabase.CreateAsset(UnityEngine.Object,System.String) fail for real instead of being simulated.
Mirrors AchievementDefinitionCreatorTests.CreateFolderThenRemoveItFromDisk.
Declaration
protected string CreateFolderThenRemoveItFromDisk(string folderName)
Parameters
| Type |
Name |
Description |
| string |
folderName |
|
Returns
OneTimeTearDown()
Every per-test deletion above goes through AssetDatabase.DeleteAsset, which updates the
asset database immediately — a manual refresh between tests is unnecessary; flushing to disk once
after the whole fixture is enough.
Declaration
public void OneTimeTearDown()
RepairTheAssetDatabaseCacheBeforeTeardown()
Declaration
protected static void RepairTheAssetDatabaseCacheBeforeTeardown()
SaveDefinition(UnityAchievementDefinition)
Declaration
protected static void SaveDefinition(UnityAchievementDefinition definition)
Parameters
SetUp()
Declaration
TearDown()
Declaration
Track(string)
Declaration
protected void Track(string assetPath)
Parameters
| Type |
Name |
Description |
| string |
assetPath |
|