"""ISK formatting tests."""

from django.test import SimpleTestCase

from shop.formatting import format_isk


class FormatIskTests(SimpleTestCase):
    def test_examples(self):
        cases = {
            0: "0 ISK",
            750: "750 ISK",
            5_000: "5K ISK",
            1_500: "1.5K ISK",
            23_000_000: "23M ISK",
            23_500_000: "23.5M ISK",
            1_000_000_000: "1B ISK",
            1_500_000_000: "1.5B ISK",
            1_234_567_890: "1.23B ISK",
            149_000_000_000: "149B ISK",
            2_000_000_000_000: "2T ISK",
        }
        for amount, expected in cases.items():
            self.assertEqual(format_isk(amount), expected, f"for {amount}")
