diff --git a/Client/Assets/Script/Tests/EditMode/PlayerProfileModuleTests.cs b/Client/Assets/Script/Tests/EditMode/PlayerProfileModuleTests.cs index 6e478cfc..e691c4b8 100644 --- a/Client/Assets/Script/Tests/EditMode/PlayerProfileModuleTests.cs +++ b/Client/Assets/Script/Tests/EditMode/PlayerProfileModuleTests.cs @@ -101,12 +101,28 @@ public sealed class PlayerProfileModuleTests Assert.That(PlayerAvatarCatalog.GetAssetPath(0), Is.EqualTo(PlayerAvatarCatalog.GetAssetPath(PlayerAvatarCatalog.DefaultAvatarId))); } + [Test] + public void AvatarPickerJson_DeclaresAllAvatarButtons() + { + string projectRoot = System.IO.Directory.GetParent(Application.dataPath).Parent.FullName; + string jsonPath = System.IO.Path.Combine(projectRoot, "Doc/UIPrefabCreater/UI_PlayerAvatarPicker.json"); + string json = System.IO.File.ReadAllText(jsonPath); + + for (int avatarId = 1; avatarId <= PlayerAvatarCatalog.Count; avatarId++) + { + string suffix = avatarId.ToString("00", System.Globalization.CultureInfo.InvariantCulture); + StringAssert.Contains("Btn_Avatar_" + suffix, json); + StringAssert.Contains("GamerPic_" + suffix + ".png", json); + } + } + #if UNITY_EDITOR [Test] public void PlayerProfileJsonFiles_PassPrefabBuilderValidation() { Assert.That(JsonUIPrefabBuilder.Validate("../Doc/UIPrefabCreater/UI_PlayerProfileHud.json").Ok, Is.True); Assert.That(JsonUIPrefabBuilder.Validate("../Doc/UIPrefabCreater/UI_PlayerProfilePanel.json").Ok, Is.True); + Assert.That(JsonUIPrefabBuilder.Validate("../Doc/UIPrefabCreater/UI_PlayerAvatarPicker.json").Ok, Is.True); } #endif }