using NUnit.Framework;
using Core.Domain.Status;
using Core.Domain.Status.Effects;

namespace DecayGrid.Tests
{
    public class StatusManagerTests
    {
        [Test]
        public void DefaultCapabilities_HaveExpectedValues()
        {
            var sm = new StatusManager();
            var caps = sm.CurrentCapabilities;
            Assert.IsTrue(caps.CanTriggerDecay);
            Assert.AreEqual(1f, caps.SpeedMultiplier, 0.001f);
            Assert.IsFalse(caps.CanHover);
        }

        [Test]
        public void SpeedBoostAlone_AppliesMultiplier()
        {
            var sm = new StatusManager();
            sm.AddEffect(new SpeedBoostEffect(10f, 1.5f));
            Assert.AreEqual(1.5f, sm.CurrentCapabilities.SpeedMultiplier, 0.001f);
        }

        [Test]
        public void LightFootedAlone_AppliesMultiplier()
        {
            var sm = new StatusManager();
            sm.AddEffect(new LightFootedEffect(10f));
            Assert.AreEqual(1.2f, sm.CurrentCapabilities.SpeedMultiplier, 0.001f);
        }

        [Test]
        public void TwoSpeedEffectsStack_Multiplicatively()
        {
            var sm = new StatusManager();
            sm.AddEffect(new LightFootedEffect(10f));      // *1.2
            sm.AddEffect(new SpeedBoostEffect(10f, 1.5f)); // *1.5
            Assert.AreEqual(1.8f, sm.CurrentCapabilities.SpeedMultiplier, 0.001f); // 1.0 * 1.2 * 1.5
        }
    }
}
