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

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


class TestContracts(unittest.TestCase):
    def test_mod_00_compute_solid_load_0(self):
        self.assertEqual(mod_00.compute_solid_load_0(256, 177), 71)

    def test_mod_00_compute_stable_load_1(self):
        self.assertEqual(mod_00.compute_stable_load_1(478, 61), 539)

    def test_mod_00_compute_rapid_index_2(self):
        self.assertEqual(mod_00.compute_rapid_index_2(116, 152), 33)

    def test_mod_01_compute_rapid_score_0(self):
        self.assertEqual(mod_01.compute_rapid_score_0(374, 244), 339)

    def test_mod_01_compute_lean_margin_1(self):
        self.assertEqual(mod_01.compute_lean_margin_1(408, 352), 77)

    def test_mod_01_compute_rapid_weight_2(self):
        self.assertEqual(mod_01.compute_rapid_weight_2(19, 240), 10)

    def test_mod_02_compute_batch_index_0(self):
        self.assertEqual(mod_02.compute_batch_index_0(121, 103), 292)

    def test_mod_02_compute_lean_weight_1(self):
        self.assertEqual(mod_02.compute_lean_weight_1(282, 305), 247)

    def test_mod_02_compute_solid_span_2(self):
        self.assertEqual(mod_02.compute_solid_span_2(157, 402), 699)

    def test_mod_03_compute_delta_load_0(self):
        self.assertEqual(mod_03.compute_delta_load_0(280, 300), 580)

    def test_mod_03_compute_stable_rate_1(self):
        self.assertEqual(mod_03.compute_stable_rate_1(439, 97), 263)

    def test_mod_03_compute_stable_margin_2(self):
        self.assertEqual(mod_03.compute_stable_margin_2(380, 32), 302)

    def test_mod_04_compute_lean_factor_0(self):
        self.assertEqual(mod_04.compute_lean_factor_0(113, 441), 508)

    def test_mod_04_compute_batch_weight_1(self):
        self.assertEqual(mod_04.compute_batch_weight_1(40, 456), 65)

    def test_mod_04_compute_solid_load_2(self):
        self.assertEqual(mod_04.compute_solid_load_2(393, 52), 192)

    def test_mod_05_compute_batch_load_0(self):
        self.assertEqual(mod_05.compute_batch_load_0(363, 152), 83)

    def test_mod_05_compute_solid_index_1(self):
        self.assertEqual(mod_05.compute_solid_index_1(269, 317), 89)

    def test_mod_05_compute_rapid_index_2(self):
        self.assertEqual(mod_05.compute_rapid_index_2(483, 379), 49)

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


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