Class AchievementSyncAssetWriterTests
EditMode tests for AchievementSyncAssetWriter: applying — or previewing — a sync plan's
accepted Pull-direction changes. Every fixture asset lives under a private temp folder and every run
passes RegisterAsAddressables = false for creations, mirroring AchievementDefinitionCreatorTests.
Inherited Members
Namespace: Serenity.UnityAchievements.Tests.Editor
Assembly: Tests.Editor.dll
Syntax
public class AchievementSyncAssetWriterTests : AchievementSyncAssetTestBase
Remarks
This assembly deliberately does not reference the Unity Localization package — see the same note on
AchievementSyncLocalSnapshotSourceTests — so the translating-achievement scenario here exercises
this writer's own decision logic (a string table that cannot be found surfaces an Error) rather than a
real string-table round trip. The write extension itself (Serenity.Global.Infrastructure.Editor.UnityLocalizationStringTableEditorUtils.TrySetStringTableEntry(System.String,System.String,System.String,System.String))
is round-trip tested against a real, ephemeral StringTableCollection in
UnityLocalizationStringTableEditorUtilsTests, which lives in an assembly that does carry
that reference.
Constructors
AchievementSyncAssetWriterTests()
Declaration
public AchievementSyncAssetWriterTests()
Methods
Apply_AcceptedHiddenChange_UpdatesTheExistingAsset()
Declaration
public void Apply_AcceptedHiddenChange_UpdatesTheExistingAsset()
Apply_ConflictItem_RecordsABlockerAndAppliesNothing()
Declaration
public void Apply_ConflictItem_RecordsABlockerAndAppliesNothing()
Apply_NonTranslatingNonAuthoringLocaleChangeAccepted_RecordsSkippedWithAWarning()
Declaration
public void Apply_NonTranslatingNonAuthoringLocaleChangeAccepted_RecordsSkippedWithAWarning()
Apply_OneItemFailsAndAnotherSucceeds_ContinuesPastTheFailure()
A plan is a batch: one item's failure must never stop the rest of the run, or a single bad row in a large pull would silently swallow everyone after it.
Declaration
public void Apply_OneItemFailsAndAnotherSucceeds_ContinuesPastTheFailure()
Apply_PlatformOnlyCreationFailsMidWrite_RecordsAnErrorAndCreatesNothing()
Declaration
public void Apply_PlatformOnlyCreationFailsMidWrite_RecordsAnErrorAndCreatesNothing()
Apply_PlatformOnlyFullyAccepted_CreatesTheAssetWithProposedIdAndApiNameMapping()
Declaration
public void Apply_PlatformOnlyFullyAccepted_CreatesTheAssetWithProposedIdAndApiNameMapping()
Apply_PlatformOnlyPartiallyAccepted_RecordsWarningAndSkippedActionsAndCreatesNothing()
Declaration
public void Apply_PlatformOnlyPartiallyAccepted_RecordsWarningAndSkippedActionsAndCreatesNothing()
Apply_PlatformOnlyWithAcceptedTextsInOtherLocales_CreatesTheAssetAndSaysWhichTextsWereLeftOut()
Declaration
public void Apply_PlatformOnlyWithAcceptedTextsInOtherLocales_CreatesTheAssetAndSaysWhichTextsWereLeftOut()
Apply_PreviewMode_WritesNothingAndMatchesTheApplyModeReportActions()
Declaration
public void Apply_PreviewMode_WritesNothingAndMatchesTheApplyModeReportActions()
Apply_PushDirectionPlan_RecordsABlockerAndAppliesNothing()
Declaration
public void Apply_PushDirectionPlan_RecordsABlockerAndAppliesNothing()
Apply_TranslatingAchievementAcceptedChange_NoMatchingStringTable_RecordsAnError()
Declaration
public void Apply_TranslatingAchievementAcceptedChange_NoMatchingStringTable_RecordsAnError()
Apply_TranslatingAchievementShippedStringTable_RecordsTheRefusalAndNeverWrites(bool)
The locale exists and the writer would succeed, but the table ships inside the Serenity package — the refusal must surface as an error naming why, in a preview as in a real apply, and the writer must never be reached.
Declaration
public void Apply_TranslatingAchievementShippedStringTable_RecordsTheRefusalAndNeverWrites(bool previewOnly)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | previewOnly |
Apply_TranslatingAchievementStringTableWriteFails_RecordsAnErrorNotAnUpdate()
The locale exists (fake provider says so) but the actual write fails (fake writer says so) — the scenario the real Serenity.Global.Infrastructure.Editor.UnityLocalizationStringTableEditorUtils.TrySetStringTableEntry(System.String,System.String,System.String,System.String) would hit if, for example, the shared key could not be resolved. Injected because this assembly does not reference the Localization package (see the type remarks), so there is no real collection whose write can be made to fail.
Declaration
public void Apply_TranslatingAchievementStringTableWriteFails_RecordsAnErrorNotAnUpdate()
Apply_UnacceptedChange_DoesNotApplyIt()
Declaration
public void Apply_UnacceptedChange_DoesNotApplyIt()