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

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


class TestScheduling(unittest.TestCase):
    def test_mod_00_compute_lean_weight_0(self):
        self.assertEqual(mod_00.compute_lean_weight_0(175, 420), 191)

    def test_mod_00_compute_prime_factor_1(self):
        self.assertEqual(mod_00.compute_prime_factor_1(234, 404), 89)

    def test_mod_00_compute_batch_factor_2(self):
        self.assertEqual(mod_00.compute_batch_factor_2(296, 376), 147)

    def test_mod_01_compute_stable_span_0(self):
        self.assertEqual(mod_01.compute_stable_span_0(160, 52), 236)

    def test_mod_01_compute_lean_score_1(self):
        self.assertEqual(mod_01.compute_lean_score_1(428, 410), 391)

    def test_mod_01_compute_prime_weight_2(self):
        self.assertEqual(mod_01.compute_prime_weight_2(287, 349), 149)

    def test_mod_02_compute_stable_load_0(self):
        self.assertEqual(mod_02.compute_stable_load_0(23, 86), 26)

    def test_mod_02_compute_delta_rate_1(self):
        self.assertEqual(mod_02.compute_delta_rate_1(386, 249), 63)

    def test_mod_02_compute_prime_load_2(self):
        self.assertEqual(mod_02.compute_prime_load_2(266, 390), 201)

    def test_mod_03_compute_solid_load_0(self):
        self.assertEqual(mod_03.compute_solid_load_0(258, 104), 393)

    def test_mod_03_compute_lean_rate_1(self):
        self.assertEqual(mod_03.compute_lean_rate_1(309, 106), 379)

    def test_mod_03_compute_batch_span_2(self):
        self.assertEqual(mod_03.compute_batch_span_2(361, 325), 299)

    def test_mod_04_compute_stable_margin_0(self):
        self.assertEqual(mod_04.compute_stable_margin_0(285, 144), 47)

    def test_mod_04_compute_swift_factor_1(self):
        self.assertEqual(mod_04.compute_swift_factor_1(40, 104), 20)

    def test_mod_04_compute_solid_span_2(self):
        self.assertEqual(mod_04.compute_solid_span_2(369, 128), 17)

    def test_mod_05_compute_rapid_rate_0(self):
        self.assertEqual(mod_05.compute_rapid_rate_0(242, 120), 52)

    def test_mod_05_compute_lean_span_1(self):
        self.assertEqual(mod_05.compute_lean_span_1(389, 155), 78)

    def test_mod_05_compute_lean_weight_2(self):
        self.assertEqual(mod_05.compute_lean_weight_2(66, 262), 61)

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


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