package fr.luc.gamingcore.economy;

import fr.luc.gamingcore.model.Guild;
import fr.luc.gamingcore.model.GuildClaim;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.UUID;

import static org.junit.jupiter.api.Assertions.*;

public class ChunkPriceCalculatorTest {

    private ChunkPriceCalculator calculator;

    @BeforeEach
    public void setUp() {
        this.calculator = new ChunkPriceCalculator();
    }

    @Test
    public void testFirstChunkPriceIsBasePrice() {
        double firstChunk = calculator.calculatePrice(1, 0);
        assertEquals(1000.0, firstChunk, 0.01);
    }

    @Test
    public void testStructuralPriceIncreasesWithChunkCount() {
        double chunk1 = calculator.calculatePrice(1, 0);
        double chunk2 = calculator.calculatePrice(2, 0);
        double chunk5 = calculator.calculatePrice(5, 0);
        double chunk10 = calculator.calculatePrice(10, 0);

        assertTrue(chunk2 > chunk1);
        assertTrue(chunk5 > chunk2);
        assertTrue(chunk10 > chunk5);
    }

    @Test
    public void testOverheatMultiplierAppliesWithRecentClaims() {
        double normalPrice = calculator.calculatePrice(6, 0);
        double overheatedPrice = calculator.calculatePrice(6, 3);
        assertTrue(overheatedPrice > normalPrice);
    }

    @Test
    public void testLargeGuildOverheatIsMoreSevereThanSmallGuild() {
        double smallMultiplier = calculator.calculateOverheatMultiplier(5, 4);
        double largeMultiplier = calculator.calculateOverheatMultiplier(50, 4);
        assertTrue(largeMultiplier > smallMultiplier);
    }
}
