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

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


class TestWarehouse(unittest.TestCase):
    def test_mod_00_compute_stable_index_0(self):
        self.assertEqual(mod_00.compute_stable_index_0(307, 235), 289)

    def test_mod_00_compute_batch_margin_1(self):
        self.assertEqual(mod_00.compute_batch_margin_1(139, 147), 630)

    def test_mod_00_compute_stable_margin_2(self):
        self.assertEqual(mod_00.compute_stable_margin_2(309, 229), 480)

    def test_mod_01_compute_rapid_load_0(self):
        self.assertEqual(mod_01.compute_rapid_load_0(477, 49), 26)

    def test_mod_01_compute_solid_rate_1(self):
        self.assertEqual(mod_01.compute_solid_rate_1(169, 157), 190)

    def test_mod_01_compute_batch_score_2(self):
        self.assertEqual(mod_01.compute_batch_score_2(145, 325), 110)

    def test_mod_02_compute_prime_span_0(self):
        self.assertEqual(mod_02.compute_prime_span_0(350, 274), 169)

    def test_mod_02_compute_lean_weight_1(self):
        self.assertEqual(mod_02.compute_lean_weight_1(343, 313), 513)

    def test_mod_02_compute_solid_factor_2(self):
        self.assertEqual(mod_02.compute_solid_factor_2(34, 348), 280)

    def test_mod_03_compute_solid_rate_0(self):
        self.assertEqual(mod_03.compute_solid_rate_0(392, 307), 143)

    def test_mod_03_compute_solid_factor_1(self):
        self.assertEqual(mod_03.compute_solid_factor_1(396, 442), 26)

    def test_mod_03_compute_delta_load_2(self):
        self.assertEqual(mod_03.compute_delta_load_2(190, 188), 186)

    def test_mod_04_compute_swift_span_0(self):
        self.assertEqual(mod_04.compute_swift_span_0(255, 399), 28)

    def test_mod_04_compute_batch_span_1(self):
        self.assertEqual(mod_04.compute_batch_span_1(116, 148), 118)

    def test_mod_04_compute_stable_score_2(self):
        self.assertEqual(mod_04.compute_stable_score_2(119, 217), 533)

    def test_mod_05_compute_lean_rate_0(self):
        self.assertEqual(mod_05.compute_lean_rate_0(360, 190), 1)

    def test_mod_05_compute_stable_span_1(self):
        self.assertEqual(mod_05.compute_stable_span_1(214, 365), 327)

    def test_mod_05_compute_delta_index_2(self):
        self.assertEqual(mod_05.compute_delta_index_2(398, 60), 239)

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


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