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

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


class TestForecast(unittest.TestCase):
    def test_mod_00_compute_lean_weight_0(self):
        self.assertEqual(mod_00.compute_lean_weight_0(166, 243), 195)

    def test_mod_00_compute_rapid_factor_1(self):
        self.assertEqual(mod_00.compute_rapid_factor_1(336, 183), 603)

    def test_mod_00_compute_stable_margin_2(self):
        self.assertEqual(mod_00.compute_stable_margin_2(265, 174), 100)

    def test_mod_01_compute_rapid_load_0(self):
        self.assertEqual(mod_01.compute_rapid_load_0(490, 465), 583)

    def test_mod_01_compute_stable_margin_1(self):
        self.assertEqual(mod_01.compute_stable_margin_1(13, 109), 137)

    def test_mod_01_compute_lean_rate_2(self):
        self.assertEqual(mod_01.compute_lean_rate_2(274, 426), 75)

    def test_mod_02_compute_delta_index_0(self):
        self.assertEqual(mod_02.compute_delta_index_0(348, 486), 68)

    def test_mod_02_compute_delta_index_1(self):
        self.assertEqual(mod_02.compute_delta_index_1(114, 291), 35)

    def test_mod_02_compute_batch_rate_2(self):
        self.assertEqual(mod_02.compute_batch_rate_2(470, 324), 316)

    def test_mod_03_compute_swift_score_0(self):
        self.assertEqual(mod_03.compute_swift_score_0(153, 173), 188)

    def test_mod_03_compute_batch_rate_1(self):
        self.assertEqual(mod_03.compute_batch_rate_1(85, 242), 296)

    def test_mod_03_compute_rapid_load_2(self):
        self.assertEqual(mod_03.compute_rapid_load_2(457, 255), 32)

    def test_mod_04_compute_solid_span_0(self):
        self.assertEqual(mod_04.compute_solid_span_0(117, 270), 277)

    def test_mod_04_compute_prime_factor_1(self):
        self.assertEqual(mod_04.compute_prime_factor_1(358, 117), 98)

    def test_mod_04_compute_lean_score_2(self):
        self.assertEqual(mod_04.compute_lean_score_2(405, 460), 336)

    def test_mod_05_compute_batch_rate_0(self):
        self.assertEqual(mod_05.compute_batch_rate_0(461, 214), 318)

    def test_mod_05_compute_batch_rate_1(self):
        self.assertEqual(mod_05.compute_batch_rate_1(109, 343), 95)

    def test_mod_05_compute_solid_rate_2(self):
        self.assertEqual(mod_05.compute_solid_rate_2(212, 314), 17)

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


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