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

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


class TestDispatch(unittest.TestCase):
    def test_mod_00_compute_batch_score_0(self):
        self.assertEqual(mod_00.compute_batch_score_0(219, 114), 174)

    def test_mod_00_compute_stable_index_1(self):
        self.assertEqual(mod_00.compute_stable_index_1(455, 479), 46)

    def test_mod_00_compute_stable_index_2(self):
        self.assertEqual(mod_00.compute_stable_index_2(455, 115), 366)

    def test_mod_01_compute_swift_index_0(self):
        self.assertEqual(mod_01.compute_swift_index_0(119, 268), 65)

    def test_mod_01_compute_delta_weight_1(self):
        self.assertEqual(mod_01.compute_delta_weight_1(152, 80), 609)

    def test_mod_01_compute_prime_weight_2(self):
        self.assertEqual(mod_01.compute_prime_weight_2(336, 357), 354)

    def test_mod_02_compute_lean_margin_0(self):
        self.assertEqual(mod_02.compute_lean_margin_0(120, 76), 22)

    def test_mod_02_compute_delta_index_1(self):
        self.assertEqual(mod_02.compute_delta_index_1(482, 460), 14)

    def test_mod_02_compute_lean_rate_2(self):
        self.assertEqual(mod_02.compute_lean_rate_2(189, 464), 558)

    def test_mod_03_compute_swift_score_0(self):
        self.assertEqual(mod_03.compute_swift_score_0(241, 8), 4)

    def test_mod_03_compute_rapid_score_1(self):
        self.assertEqual(mod_03.compute_rapid_score_1(266, 176), 550)

    def test_mod_03_compute_rapid_span_2(self):
        self.assertEqual(mod_03.compute_rapid_span_2(5, 230), 55)

    def test_mod_04_compute_delta_rate_0(self):
        self.assertEqual(mod_04.compute_delta_rate_0(363, 376), 523)

    def test_mod_04_compute_swift_index_1(self):
        self.assertEqual(mod_04.compute_swift_index_1(320, 126), 281)

    def test_mod_04_compute_stable_factor_2(self):
        self.assertEqual(mod_04.compute_stable_factor_2(444, 490), 435)

    def test_mod_05_compute_solid_index_0(self):
        self.assertEqual(mod_05.compute_solid_index_0(198, 353), 242)

    def test_mod_05_compute_lean_weight_1(self):
        self.assertEqual(mod_05.compute_lean_weight_1(366, 341), 122)

    def test_mod_05_compute_batch_load_2(self):
        self.assertEqual(mod_05.compute_batch_load_2(199, 161), 65)

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


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