"No","テストID","対象クラス","対象メソッド","テスト観点","テストケース名","前提条件","入力値","期待結果","優先度","備考"
"1","UT-ENC-001","Channel::Voice","phone_number validation","正常系","E.164形式の電話番号が登録できること","なし","phone_number=""+81901234567""","バリデーションが通過する","高","国際電話番号フォーマット"
"2","UT-ENC-002","Channel::Voice","phone_number validation","異常系","プラス記号なしの電話番号が拒否されること","なし","phone_number=""81901234567""","バリデーションエラー（format）","高","E.164フォーマット必須"
"3","UT-ENC-003","Channel::Voice","phone_number validation","異常系","空の電話番号が拒否されること","なし","phone_number=nil","バリデーションエラー（presence）","高","必須項目チェック"
"4","UT-ENC-004","Channel::Voice","phone_number validation","異常系","重複した電話番号が拒否されること","同じ電話番号のチャネルが存在","phone_number=""+81901234567""（既存）","バリデーションエラー（uniqueness）","高","一意性制約"
"5","UT-ENC-005","Channel::Voice","phone_number validation","境界値","最小桁数（+と2桁）の電話番号","なし","phone_number=""+12""","バリデーションが通過する","中","境界値テスト"
"6","UT-ENC-006","Channel::Voice","phone_number validation","境界値","最大桁数（+と15桁）の電話番号","なし","phone_number=""+123456789012345""","バリデーションが通過する","中","E.164最大長"
"7","UT-ENC-007","Channel::Voice","phone_number validation","境界値","最大桁数超過（+と16桁）の電話番号","なし","phone_number=""+1234567890123456""","バリデーションエラー（format）","中","E.164最大長超過"
"8","UT-ENC-008","Channel::Voice","phone_number validation","異常系","+0で始まる電話番号が拒否されること","なし","phone_number=""+0123456789""","バリデーションエラー（format）","中","国番号0は無効"
"9","UT-ENC-009","Channel::Voice","provider validation","正常系","providerが設定されていること","なし","provider=""twilio""","バリデーションが通過する","高","必須項目"
"10","UT-ENC-010","Channel::Voice","provider validation","異常系","空のproviderが拒否されること","なし","provider=nil","バリデーションエラー（presence）","高","必須項目チェック"
"11","UT-ENC-011","Channel::Voice","provider_config validation","正常系","provider_configが設定されていること","なし","provider_config={account_sid: ""xxx"", ...}","バリデーションが通過する","高","必須項目"
"12","UT-ENC-012","Channel::Voice","provider_config validation","異常系","空のprovider_configが拒否されること","なし","provider_config=nil","バリデーションエラー（presence）","高","必須項目チェック"
"13","UT-ENC-013","Channel::Voice","validate_twilio_config","正常系","必要なTwilio設定がすべて存在する場合","provider=""twilio""","provider_config={account_sid, auth_token, api_key_sid, api_key_secret, twiml_app_sid}","バリデーションが通過する","高","Twilio必須キー検証"
"14","UT-ENC-014","Channel::Voice","validate_twilio_config","異常系","account_sidが欠けている場合","provider=""twilio""","provider_config={auth_token, api_key_sid, api_key_secret, twiml_app_sid}","バリデーションエラー（account_sid is required）","高","Twilio必須キー検証"
"15","UT-ENC-015","Channel::Voice","validate_twilio_config","異常系","auth_tokenが欠けている場合","provider=""twilio""","provider_config={account_sid, api_key_sid, api_key_secret, twiml_app_sid}","バリデーションエラー（auth_token is required）","高","Twilio必須キー検証"
"16","UT-ENC-016","Channel::Voice","validate_twilio_config","異常系","api_key_sidが欠けている場合","provider=""twilio""","provider_config={account_sid, auth_token, api_key_secret, twiml_app_sid}","バリデーションエラー（api_key_sid is required）","高","Twilio必須キー検証"
"17","UT-ENC-017","Channel::Voice","validate_twilio_config","異常系","api_key_secretが欠けている場合","provider=""twilio""","provider_config={account_sid, auth_token, api_key_sid, twiml_app_sid}","バリデーションエラー（api_key_secret is required）","高","Twilio必須キー検証"
"18","UT-ENC-018","Channel::Voice","validate_twilio_config","異常系","twiml_app_sidが欠けている場合","provider=""twilio""","provider_config={account_sid, auth_token, api_key_sid, api_key_secret}","バリデーションエラー（twiml_app_sid is required）","高","Twilio必須キー検証"
"19","UT-ENC-019","Channel::Voice","account_id validation","正常系","account_idが設定されていること（Channelable）","アカウントが存在","account_id=1","バリデーションが通過する","高","Channelable由来"
"20","UT-ENC-020","Channel::Voice","account_id validation","異常系","空のaccount_idが拒否されること（Channelable）","なし","account_id=nil","バリデーションエラー（presence）","高","Channelable由来"
"21","UT-ENC-021","Channel::Voice","account relation","正常系","accountリレーションが正しく取得できること（Channelable）","関連するアカウントが存在","channel.account","Accountオブジェクトが返却される","中","Channelable由来"
"22","UT-ENC-022","Channel::Voice","inbox relation","正常系","inboxリレーションが正しく取得できること（Channelable）","関連するInboxが存在","channel.inbox","Inboxオブジェクトが返却される","中","Channelable由来"
"23","UT-ENC-023","Channel::Voice","inbox relation","正常系","チャネル削除時にinboxが非同期削除されること（Channelable）","関連するInboxが存在","channel.destroy","Inboxがdestroy_asyncで削除される","中","Channelable dependent設定"
"24","UT-ENC-024","Channel::Voice","name","正常系","チャネル名が正しく返却されること","phone_number=""+81901234567""","channel.name","""Voice (+81901234567)""が返却される","低","表示用メソッド"
"25","UT-ENC-025","Channel::Voice","messaging_window_enabled?","正常系","falseが返却されること","なし","channel.messaging_window_enabled?","falseが返却される","低","音声チャネルはメッセージングウィンドウ無効"
"26","UT-ENC-026","Channel::Voice","initiate_call","正常系","Twilioプロバイダーで電話発信できること","provider=""twilio""、有効な設定","initiate_call(to: ""+81909876543"")","Twilio::Adapterが呼び出される","高","電話発信機能"
"27","UT-ENC-027","Channel::Voice","initiate_call","正常系","conference_sidを指定して電話発信できること","provider=""twilio""、有効な設定","initiate_call(to: ""+81909876543"", conference_sid: ""CFxxx"")","conference_sidがAdapterに渡される","高","会議通話機能"
"28","UT-ENC-028","Channel::Voice","initiate_call","正常系","agent_idを指定して電話発信できること","provider=""twilio""、有効な設定","initiate_call(to: ""+81909876543"", agent_id: 1)","agent_idがAdapterに渡される","高","エージェント指定発信"
"29","UT-ENC-029","Channel::Voice","initiate_call","異常系","未サポートプロバイダーでエラーになること","provider=""unknown""","initiate_call(to: ""+81909876543"")","例外""Unsupported voice provider: unknown""が発生","高","プロバイダー検証"
"30","UT-ENC-030","Channel::Voice","voice_call_webhook_url","正常系","コールウェブフックURLが正しく生成されること","phone_number=""+81901234567""","channel.voice_call_webhook_url","twilio_voice_call_url(phone: ""81901234567"")が返却される","中","Webhook URL生成"
"31","UT-ENC-031","Channel::Voice","voice_call_webhook_url","正常系","電話番号から+が除去されること","phone_number=""+12025551234""","channel.voice_call_webhook_url","phone=""12025551234""でURLが生成される","中","プレフィックス除去"
"32","UT-ENC-032","Channel::Voice","voice_status_webhook_url","正常系","ステータスウェブフックURLが正しく生成されること","phone_number=""+81901234567""","channel.voice_status_webhook_url","twilio_voice_status_url(phone: ""81901234567"")が返却される","中","Webhook URL生成"
"33","UT-ENC-033","Channel::Voice","voice_status_webhook_url","正常系","電話番号から+が除去されること","phone_number=""+12025551234""","channel.voice_status_webhook_url","phone=""12025551234""でURLが生成される","中","プレフィックス除去"
"34","UT-ENC-034","Channel::Voice","provider_config_hash","正常系","Hashの場合そのまま返却されること","provider_config={key: ""value""}","channel.provider_config_hash","{key: ""value""}が返却される","中","型変換なし"
"35","UT-ENC-035","Channel::Voice","provider_config_hash","正常系","Hash以外の場合JSON.parseされること","provider_config=""{\""key\"": \""value\""}""","channel.provider_config_hash","{""key"" => ""value""}が返却される","中","JSON文字列からの変換"
"36","UT-ENC-036","Channel::Voice","twilio?","正常系","providerがtwilioの場合trueが返却されること","provider=""twilio""","channel.send(:twilio?)","trueが返却される","低","プライベートメソッド"
"37","UT-ENC-037","Channel::Voice","twilio?","正常系","providerがtwilio以外の場合falseが返却されること","provider=""other""","channel.send(:twilio?)","falseが返却される","低","プライベートメソッド"
"38","UT-ENC-038","Channel::Voice","provision_twilio_on_create","正常系","新規作成時にTwilio TwiML Appがプロビジョニングされること","provider=""twilio""、有効な設定、create実行","channel.create","provider_configにtwiml_app_sidが追加される","高","自動プロビジョニング"
"39","UT-ENC-039","Channel::Voice","provision_twilio_on_create","異常系","プロビジョニング失敗時にエラーが記録されること","provider=""twilio""、Twilioサービスがエラー","channel.create","エラーログが出力され、baseにエラーが追加される","高","エラーハンドリング"
"40","UT-ENC-040","Channel::Voice","provision_twilio_on_create","正常系","app_sidが空の場合provider_configが更新されないこと","provider=""twilio""、サービスが空を返す","channel.create","provider_configが変更されない","中","空レスポンスの処理"
"41","UT-ENC-041","Channel::Voice","provision_twilio_on_create","正常系","provider=""other""の場合プロビジョニングがスキップされること","provider=""other""","channel.create","provision_twilio_on_createが呼び出されない","中","条件付きコールバック"
"42","UT-ENC-042","Channel::Voice","validate_provider_config","正常系","provider_configが空の場合バリデーションがスキップされること","provider=""twilio""","provider_config=nil（presenceは別でチェック）","validate_twilio_configが呼び出されない","中","早期リターン"
"43","UT-ENC-043","Channel::Voice","table_name","正常系","テーブル名がchannel_voiceであること","なし","Channel::Voice.table_name","""channel_voice""が返却される","低","テーブル名設定"
"44","UT-ENC-044","Channel::Voice","EDITABLE_ATTRS","正常系","編集可能属性が正しく定義されていること","なし","Channel::Voice::EDITABLE_ATTRS","[:phone_number, :provider, {provider_config: {}}]が返却される","低","定数定義"
"45","UT-ENC-045","Channel::Voice","create_audit_log_entry","正常系","更新時にaudit_log_entryが作成されること（Channelable）","チャネルが存在","channel.update(phone_number: ""+81909999999"")","create_audit_log_entryが呼び出される","中","Channelable コールバック"
