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

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


class TestTracking(unittest.TestCase):
    def test_mod_00_compute_batch_margin_0(self):
        self.assertEqual(mod_00.compute_batch_margin_0(28, 52), 51)

    def test_mod_00_compute_solid_span_1(self):
        self.assertEqual(mod_00.compute_solid_span_1(28, 214), 298)

    def test_mod_00_compute_delta_margin_2(self):
        self.assertEqual(mod_00.compute_delta_margin_2(321, 458), 218)

    def test_mod_01_compute_lean_score_0(self):
        self.assertEqual(mod_01.compute_lean_score_0(61, 138), 111)

    def test_mod_01_compute_swift_load_1(self):
        self.assertEqual(mod_01.compute_swift_load_1(181, 119), 148)

    def test_mod_01_compute_delta_margin_2(self):
        self.assertEqual(mod_01.compute_delta_margin_2(473, 172), 459)

    def test_mod_02_compute_batch_index_0(self):
        self.assertEqual(mod_02.compute_batch_index_0(487, 488), 47)

    def test_mod_02_compute_prime_load_1(self):
        self.assertEqual(mod_02.compute_prime_load_1(54, 41), 215)

    def test_mod_02_compute_swift_rate_2(self):
        self.assertEqual(mod_02.compute_swift_rate_2(192, 37), 151)

    def test_mod_03_compute_lean_rate_0(self):
        self.assertEqual(mod_03.compute_lean_rate_0(91, 304), 331)

    def test_mod_03_compute_swift_margin_1(self):
        self.assertEqual(mod_03.compute_swift_margin_1(469, 407), 507)

    def test_mod_03_compute_rapid_margin_2(self):
        self.assertEqual(mod_03.compute_rapid_margin_2(450, 155), 42)

    def test_mod_04_compute_swift_score_0(self):
        self.assertEqual(mod_04.compute_swift_score_0(213, 223), 47)

    def test_mod_04_compute_delta_rate_1(self):
        self.assertEqual(mod_04.compute_delta_rate_1(422, 197), 224)

    def test_mod_04_compute_swift_score_2(self):
        self.assertEqual(mod_04.compute_swift_score_2(422, 219), 85)

    def test_mod_05_compute_swift_margin_0(self):
        self.assertEqual(mod_05.compute_swift_margin_0(314, 67), 110)

    def test_mod_05_compute_batch_rate_1(self):
        self.assertEqual(mod_05.compute_batch_rate_1(47, 265), 162)

    def test_mod_05_compute_prime_score_2(self):
        self.assertEqual(mod_05.compute_prime_score_2(118, 208), 297)

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


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