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

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


class TestRouting(unittest.TestCase):
    def test_mod_00_compute_prime_span_0(self):
        self.assertEqual(mod_00.compute_prime_span_0(225, 132), 286)

    def test_mod_00_compute_solid_span_1(self):
        self.assertEqual(mod_00.compute_solid_span_1(374, 433), 328)

    def test_mod_00_compute_prime_index_2(self):
        self.assertEqual(mod_00.compute_prime_index_2(364, 314), 320)

    def test_mod_01_compute_lean_weight_0(self):
        self.assertEqual(mod_01.compute_lean_weight_0(414, 488), 57)

    def test_mod_01_compute_swift_index_1(self):
        self.assertEqual(mod_01.compute_swift_index_1(387, 190), 130)

    def test_mod_01_compute_rapid_load_2(self):
        self.assertEqual(mod_01.compute_rapid_load_2(189, 10), 136)

    def test_mod_02_compute_batch_load_0(self):
        self.assertEqual(mod_02.compute_batch_load_0(16, 454), 15)

    def test_mod_02_compute_solid_score_1(self):
        self.assertEqual(mod_02.compute_solid_score_1(413, 193), 107)

    def test_mod_02_compute_lean_load_2(self):
        self.assertEqual(mod_02.compute_lean_load_2(255, 71), 128)

    def test_mod_03_compute_rapid_margin_0(self):
        self.assertEqual(mod_03.compute_rapid_margin_0(355, 489), 327)

    def test_mod_03_compute_prime_margin_1(self):
        self.assertEqual(mod_03.compute_prime_margin_1(109, 258), 75)

    def test_mod_03_compute_lean_score_2(self):
        self.assertEqual(mod_03.compute_lean_score_2(414, 138), 105)

    def test_mod_04_compute_lean_rate_0(self):
        self.assertEqual(mod_04.compute_lean_rate_0(330, 428), 50)

    def test_mod_04_compute_solid_load_1(self):
        self.assertEqual(mod_04.compute_solid_load_1(142, 443), 34)

    def test_mod_04_compute_swift_factor_2(self):
        self.assertEqual(mod_04.compute_swift_factor_2(87, 22), 233)

    def test_mod_05_compute_prime_index_0(self):
        self.assertEqual(mod_05.compute_prime_index_0(130, 424), 168)

    def test_mod_05_compute_batch_weight_1(self):
        self.assertEqual(mod_05.compute_batch_weight_1(172, 15), 200)

    def test_mod_05_compute_lean_margin_2(self):
        self.assertEqual(mod_05.compute_lean_margin_2(471, 440), 240)

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


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