using System; using System.IO; using Paca.Mobile.Core; using Paca.Tests.Infrastructure; using Xunit; namespace Paca.Tests.Mobile; /// /// 모바일 프로덕션 레벨 디자인 시스템, 테마, 아이콘, 탭 및 에셋 무결성 게이트 (Gate 82 ~ Gate 86) /// public class MobileDesignSystemGateTests { private static string MobileProjectDir => Directory.Exists(Path.Combine(SourceTree.Root, "src", "Paca.Mobile")) ? Path.Combine(SourceTree.Root, "src", "Paca.Mobile") : Path.Combine(SourceTree.Root, "Paca.Mobile"); [Fact] public void Gate82_MobileThemeSystem_Themes_And_Tokens_Audit() { // 1. 테마 모드 정의 확인 Assert.True(Enum.IsDefined(typeof(MobileThemeMode), MobileThemeMode.Dark)); Assert.True(Enum.IsDefined(typeof(MobileThemeMode), MobileThemeMode.Light)); Assert.True(Enum.IsDefined(typeof(MobileThemeMode), MobileThemeMode.HighContrast)); Assert.True(Enum.IsDefined(typeof(MobileThemeMode), MobileThemeMode.SystemAuto)); // 2. 테마별 팔레트 토큰 검증 var darkPalette = MobileThemeSystem.GetPalette(MobileThemeMode.Dark); Assert.Equal("#0B0C10", darkPalette.Background); Assert.Equal("#161822", darkPalette.Surface1); Assert.Equal("#5E56E8", darkPalette.Accent); Assert.Equal("#FFFFFF", darkPalette.TextPrimary); Assert.Equal("#94A3B8", darkPalette.TextSecondary); var lightPalette = MobileThemeSystem.GetPalette(MobileThemeMode.Light); Assert.Equal("#F8FAFC", lightPalette.Background); Assert.Equal("#FFFFFF", lightPalette.Surface1); Assert.Equal("#4F46E5", lightPalette.Accent); Assert.Equal("#0F172A", lightPalette.TextPrimary); var hcPalette = MobileThemeSystem.GetPalette(MobileThemeMode.HighContrast); Assert.Equal("#000000", hcPalette.Background); Assert.Equal("#FFFF00", hcPalette.Accent); Assert.Equal("#FFFFFF", hcPalette.TextPrimary); } [Fact] public void Gate83_MobileIconSystem_Glyphs_Completeness_Audit() { // 모바일 프로덕션 필수 아이콘 글리프 정의 검증 Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Queue)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Discover)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Browser)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Favorites)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.SyncSettings)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Play)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Pause)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Retry)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Delete)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Pin)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Download)); Assert.False(string.IsNullOrWhiteSpace(MobileIconSystem.Check)); } [Fact] public void Gate84_MobileTouchTarget_Standard_Audit() { // 모바일 인간공학 최소 터치 규격 및 패딩 검증 Assert.Equal(48.0, MobileThemeSystem.MinTouchTargetDp); Assert.Equal(8.0, MobileThemeSystem.BaseGridUnitDp); Assert.Equal(12.0, MobileThemeSystem.CornerRadiusCardDp); Assert.Equal(24.0, MobileThemeSystem.CornerRadiusPillDp); } [Fact] public void Gate85_MobileTabModel_Navigation_Audit() { // 5대 탭 시스템 모델 무결성 검증 var tabs = MobileNavigationModel.GetDefaultTabs(); Assert.Equal(5, tabs.Count); Assert.Equal(MobileTabKind.Queue, tabs[0].Kind); Assert.Equal("대기열", tabs[0].Title); Assert.Equal(MobileTabKind.Discover, tabs[1].Kind); Assert.Equal("탐색", tabs[1].Title); Assert.Equal(MobileTabKind.Browser, tabs[2].Kind); Assert.Equal("브라우저", tabs[2].Title); Assert.Equal(MobileTabKind.Favorites, tabs[3].Kind); Assert.Equal("보관함", tabs[3].Title); Assert.Equal(MobileTabKind.SyncSettings, tabs[4].Kind); Assert.Equal("동기화", tabs[4].Title); // 뱃지 업데이트 지원 tabs[0].BadgeCount = 3; Assert.Equal(3, tabs[0].BadgeCount); } [Fact] public void Gate86_Mobile_Generated_Assets_Existence_Audit() { // 이미지 생성 도구로 제작되어 저장된 에셋 검증 var iconPath = Path.Combine(MobileProjectDir, "Resources", "AppIcon", "paca_app_icon.png"); var splashPath = Path.Combine(MobileProjectDir, "Resources", "Splash", "paca_splash_screen.png"); var emptyPath = Path.Combine(MobileProjectDir, "Resources", "Images", "paca_empty_queue.png"); Assert.True(File.Exists(iconPath), $"앱 아이콘이 존재해야 합니다: {iconPath}"); Assert.True(File.Exists(splashPath), $"스플래시 이미지가 존재해야 합니다: {splashPath}"); Assert.True(File.Exists(emptyPath), $"빈 큐 일러스트가 존재해야 합니다: {emptyPath}"); Assert.True(new FileInfo(iconPath).Length > 10000, "앱 아이콘 파일 크기가 정상이어야 합니다."); Assert.True(new FileInfo(splashPath).Length > 10000, "스플래시 파일 크기가 정상이어야 합니다."); Assert.True(new FileInfo(emptyPath).Length > 10000, "빈 큐 일러스트 파일 크기가 정상이어야 합니다."); } [Fact] public void Gate180_MobileThemeSystem_UltraCompact_And_DoubleBezel_Tokens_Audit() { // 스위스 미니멀리즘 초고밀도 컴팩트 디자인 토큰 및 더블 베젤 색상 규격 검증 Assert.Equal(34.0, MobileThemeSystem.CompactItemHeightDp); Assert.Equal(56.0, MobileThemeSystem.CompactRowHeightDp); Assert.Equal("#10111A", MobileThemeSystem.SurfaceShell); Assert.Equal("#151624", MobileThemeSystem.SurfaceCore); Assert.Equal("#23253A", MobileThemeSystem.BorderHairline); Assert.Equal("#08080C", MobileThemeSystem.OLEDBackground); Assert.Equal("#8B7CFF", MobileThemeSystem.AccentViolet); Assert.Equal("#10B981", MobileThemeSystem.AccentEmerald); } }