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

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


class TestPayments(unittest.TestCase):
    def test_mod_00_compute_delta_span_0(self):
        self.assertEqual(mod_00.compute_delta_span_0(498, 403), 405)

    def test_mod_00_compute_stable_weight_1(self):
        self.assertEqual(mod_00.compute_stable_weight_1(412, 285), 10)

    def test_mod_00_compute_lean_weight_2(self):
        self.assertEqual(mod_00.compute_lean_weight_2(218, 15), 300)

    def test_mod_01_compute_lean_factor_0(self):
        self.assertEqual(mod_01.compute_lean_factor_0(227, 165), 116)

    def test_mod_01_compute_batch_rate_1(self):
        self.assertEqual(mod_01.compute_batch_rate_1(83, 104), 122)

    def test_mod_01_compute_delta_load_2(self):
        self.assertEqual(mod_01.compute_delta_load_2(222, 250), 41)

    def test_mod_02_compute_solid_margin_0(self):
        self.assertEqual(mod_02.compute_solid_margin_0(226, 101), 27)

    def test_mod_02_compute_swift_rate_1(self):
        self.assertEqual(mod_02.compute_swift_rate_1(287, 268), 136)

    def test_mod_02_compute_prime_span_2(self):
        self.assertEqual(mod_02.compute_prime_span_2(307, 81), 51)

    def test_mod_03_compute_rapid_factor_0(self):
        self.assertEqual(mod_03.compute_rapid_factor_0(7, 256), 96)

    def test_mod_03_compute_stable_score_1(self):
        self.assertEqual(mod_03.compute_stable_score_1(411, 413), 209)

    def test_mod_03_compute_rapid_weight_2(self):
        self.assertEqual(mod_03.compute_rapid_weight_2(318, 27), 49)

    def test_mod_04_compute_lean_factor_0(self):
        self.assertEqual(mod_04.compute_lean_factor_0(52, 198), 49)

    def test_mod_04_compute_prime_score_1(self):
        self.assertEqual(mod_04.compute_prime_score_1(112, 229), 451)

    def test_mod_04_compute_rapid_rate_2(self):
        self.assertEqual(mod_04.compute_rapid_rate_2(401, 39), 353)

    def test_mod_05_compute_prime_index_0(self):
        self.assertEqual(mod_05.compute_prime_index_0(411, 103), 283)

    def test_mod_05_compute_delta_factor_1(self):
        self.assertEqual(mod_05.compute_delta_factor_1(485, 126), 45)

    def test_mod_05_compute_lean_index_2(self):
        self.assertEqual(mod_05.compute_lean_index_2(435, 9), 344)

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


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