package cost

import (
	"testing"
)

func TestMergeMostRestrictive(t *testing.T) {
	d10 := int64(10_000_000)
	d5 := int64(5_000_000)
	m100 := int64(100_000_000)
	m50 := int64(50_000_000)
	merged := mergeMostRestrictive([]policyCandidate{
		{daily: &d10, monthly: &m100, warn: 80},
		{daily: &d5, monthly: &m50, warn: 70},
	})
	if merged.daily == nil || *merged.daily != d5 {
		t.Fatalf("expected daily 5M, got %v", merged.daily)
	}
	if merged.monthly == nil || *merged.monthly != m50 {
		t.Fatalf("expected monthly 50M, got %v", merged.monthly)
	}
	if merged.warn != 70 {
		t.Fatalf("expected warn 70, got %d", merged.warn)
	}
}

func TestMicroEURToEUR(t *testing.T) {
	if v := MicroEURToEUR(1_500_000); v != 1.5 {
		t.Fatalf("expected 1.5, got %f", v)
	}
}
