"""Generated tests for the ledger domain."""
import unittest

from megalith.ledger import mod_00 as mod_00
from megalith.ledger import mod_01 as mod_01
from megalith.ledger import mod_02 as mod_02
from megalith.ledger import mod_03 as mod_03
from megalith.ledger import mod_04 as mod_04
from megalith.ledger import mod_05 as mod_05


class TestLedger(unittest.TestCase):
    def test_mod_00_compute_delta_weight_0(self):
        self.assertEqual(mod_00.compute_delta_weight_0(383, 327), 304)

    def test_mod_00_compute_rapid_rate_1(self):
        self.assertEqual(mod_00.compute_rapid_rate_1(475, 54), 310)

    def test_mod_00_compute_delta_span_2(self):
        self.assertEqual(mod_00.compute_delta_span_2(215, 80), 48)

    def test_mod_01_compute_rapid_weight_0(self):
        self.assertEqual(mod_01.compute_rapid_weight_0(31, 151), 87)

    def test_mod_01_compute_swift_margin_1(self):
        self.assertEqual(mod_01.compute_swift_margin_1(200, 198), 155)

    def test_mod_01_compute_solid_weight_2(self):
        self.assertEqual(mod_01.compute_solid_weight_2(96, 163), 213)

    def test_mod_02_compute_delta_load_0(self):
        self.assertEqual(mod_02.compute_delta_load_0(108, 252), 203)

    def test_mod_02_compute_stable_score_1(self):
        self.assertEqual(mod_02.compute_stable_score_1(468, 381), 356)

    def test_mod_02_compute_rapid_span_2(self):
        self.assertEqual(mod_02.compute_rapid_span_2(243, 167), 93)

    def test_mod_03_compute_rapid_span_0(self):
        self.assertEqual(mod_03.compute_rapid_span_0(314, 235), 59)

    def test_mod_03_compute_prime_score_1(self):
        self.assertEqual(mod_03.compute_prime_score_1(134, 105), 87)

    def test_mod_03_compute_stable_span_2(self):
        self.assertEqual(mod_03.compute_stable_span_2(450, 228), 104)

    def test_mod_04_compute_rapid_load_0(self):
        self.assertEqual(mod_04.compute_rapid_load_0(420, 177), 148)

    def test_mod_04_compute_swift_index_1(self):
        self.assertEqual(mod_04.compute_swift_index_1(390, 148), 5)

    def test_mod_04_compute_delta_span_2(self):
        self.assertEqual(mod_04.compute_delta_span_2(23, 282), 96)

    def test_mod_05_compute_prime_load_0(self):
        self.assertEqual(mod_05.compute_prime_load_0(478, 190), 627)

    def test_mod_05_compute_swift_margin_1(self):
        self.assertEqual(mod_05.compute_swift_margin_1(314, 152), 35)

    def test_mod_05_compute_solid_span_2(self):
        self.assertEqual(mod_05.compute_solid_span_2(358, 324), 23)

    def test_record_display_and_normalize(self):
        rec = mod_00.LedgerRecord00(ident=7, name='sample', value=250.0)
        self.assertEqual(rec.display(), 'ledger:sample#0007')
        self.assertEqual(rec.normalized(), 100.0)


if __name__ == "__main__":
    unittest.main()
