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

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


class TestInsurance(unittest.TestCase):
    def test_mod_00_compute_delta_index_0(self):
        self.assertEqual(mod_00.compute_delta_index_0(71, 97), 11)

    def test_mod_00_compute_swift_margin_1(self):
        self.assertEqual(mod_00.compute_swift_margin_1(149, 443), 292)

    def test_mod_00_compute_swift_margin_2(self):
        self.assertEqual(mod_00.compute_swift_margin_2(42, 202), 315)

    def test_mod_01_compute_swift_weight_0(self):
        self.assertEqual(mod_01.compute_swift_weight_0(293, 454), 642)

    def test_mod_01_compute_stable_margin_1(self):
        self.assertEqual(mod_01.compute_stable_margin_1(37, 396), 226)

    def test_mod_01_compute_rapid_margin_2(self):
        self.assertEqual(mod_01.compute_rapid_margin_2(238, 168), 525)

    def test_mod_02_compute_delta_span_0(self):
        self.assertEqual(mod_02.compute_delta_span_0(148, 101), 90)

    def test_mod_02_compute_delta_rate_1(self):
        self.assertEqual(mod_02.compute_delta_rate_1(303, 246), 570)

    def test_mod_02_compute_delta_index_2(self):
        self.assertEqual(mod_02.compute_delta_index_2(295, 101), 73)

    def test_mod_03_compute_solid_weight_0(self):
        self.assertEqual(mod_03.compute_solid_weight_0(190, 490), 139)

    def test_mod_03_compute_stable_load_1(self):
        self.assertEqual(mod_03.compute_stable_load_1(244, 262), 286)

    def test_mod_03_compute_rapid_factor_2(self):
        self.assertEqual(mod_03.compute_rapid_factor_2(306, 349), 446)

    def test_mod_04_compute_swift_factor_0(self):
        self.assertEqual(mod_04.compute_swift_factor_0(150, 157), 49)

    def test_mod_04_compute_stable_weight_1(self):
        self.assertEqual(mod_04.compute_stable_weight_1(409, 6), 18)

    def test_mod_04_compute_rapid_span_2(self):
        self.assertEqual(mod_04.compute_rapid_span_2(49, 9), 493)

    def test_mod_05_compute_delta_span_0(self):
        self.assertEqual(mod_05.compute_delta_span_0(283, 195), 87)

    def test_mod_05_compute_rapid_span_1(self):
        self.assertEqual(mod_05.compute_rapid_span_1(343, 223), 339)

    def test_mod_05_compute_swift_score_2(self):
        self.assertEqual(mod_05.compute_swift_score_2(88, 310), 50)

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


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