using FishDice.Demo;
using NUnit.Framework;

namespace FishDice.Tests.LuckyDice
{
    public sealed class LuckyDiceDemoTests
    {
        [Test]
        public void DemoRunner_formats_normal_reward_flow()
        {
            var snapshot = LuckyDiceDemoRunner.RunScenario(
                new LuckyDiceDemoScenario("Normal Reward", "Numbers pay the base reward.", 0, 1));

            Assert.That(snapshot.Title, Is.EqualTo("Normal Reward"));
            Assert.That(snapshot.FaceLine, Is.EqualTo("Faces: 2 + 3"));
            Assert.That(snapshot.ComboLine, Is.EqualTo("Combo: 2_3"));
            Assert.That(snapshot.RuleLine, Is.EqualTo("Rules: normal_all_numbers_reward"));
            Assert.That(snapshot.EffectLine, Is.EqualTo("Effects: Reward"));
            Assert.That(snapshot.TargetModeLine, Is.EqualTo("Target Mode: -"));
        }

        [Test]
        public void DemoRunner_formats_lucky_dice_target_mode_flow()
        {
            var snapshot = LuckyDiceDemoRunner.RunScenario(
                new LuckyDiceDemoScenario("Lucky Dice", "Clover pair enters the special dice flow.", 5, 5, 0));

            Assert.That(snapshot.FaceLine, Is.EqualTo("Faces: clover + clover"));
            Assert.That(snapshot.ComboLine, Is.EqualTo("Combo: clover_clover"));
            Assert.That(snapshot.RuleLine, Is.EqualTo("Rules: normal_clover_clover_lucky_dice"));
            Assert.That(snapshot.EffectLine, Is.EqualTo("Effects: LuckyDiceRequested, EnterTargetMode"));
            Assert.That(snapshot.LuckyDiceLine, Is.EqualTo("Lucky Dice: rocket x3"));
            Assert.That(snapshot.TargetModeLine, Is.EqualTo("Target Mode: slap_down_normal"));
        }

        [Test]
        public void DemoRunner_exposes_structured_faces_for_player_ui_flow()
        {
            var normal = LuckyDiceDemoRunner.RunScenario(
                new LuckyDiceDemoScenario("Normal Reward", "Numbers pay the base reward.", 0, 1));
            var lucky = LuckyDiceDemoRunner.RunScenario(
                new LuckyDiceDemoScenario("Lucky Dice", "Clover pair enters the special dice flow.", 5, 5, 0));

            Assert.That(normal.NormalFaces, Is.EqualTo(new[] { "2", "3" }));
            Assert.That(normal.LuckyDiceSlotKeys, Is.Empty);
            Assert.That(normal.OutcomeKind, Is.EqualTo("normal_reward"));

            Assert.That(lucky.NormalFaces, Is.EqualTo(new[] { "clover", "clover" }));
            Assert.That(lucky.LuckyDiceSlotKeys, Is.EqualTo(new[] { "rocket", "rocket", "rocket" }));
            Assert.That(lucky.OutcomeKind, Is.EqualTo("lucky_dice"));
        }

        [Test]
        public void DemoController_uses_current_unity_builtin_font_for_player_ui_text()
        {
            Assert.That(LuckyDiceDemoController.BuiltinFontResourcePath, Is.EqualTo("LegacyRuntime.ttf"));
        }
    }
}
