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

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


class TestInventory(unittest.TestCase):
    def test_mod_00_compute_delta_weight_0(self):
        self.assertEqual(mod_00.compute_delta_weight_0(238, 417), 276)

    def test_mod_00_compute_delta_weight_1(self):
        self.assertEqual(mod_00.compute_delta_weight_1(500, 32), 303)

    def test_mod_00_compute_prime_span_2(self):
        self.assertEqual(mod_00.compute_prime_span_2(489, 380), 74)

    def test_mod_01_compute_delta_factor_0(self):
        self.assertEqual(mod_01.compute_delta_factor_0(390, 485), 498)

    def test_mod_01_compute_swift_load_1(self):
        self.assertEqual(mod_01.compute_swift_load_1(217, 343), 88)

    def test_mod_01_compute_solid_factor_2(self):
        self.assertEqual(mod_01.compute_solid_factor_2(73, 228), 327)

    def test_mod_02_compute_swift_weight_0(self):
        self.assertEqual(mod_02.compute_swift_weight_0(90, 316), 231)

    def test_mod_02_compute_batch_rate_1(self):
        self.assertEqual(mod_02.compute_batch_rate_1(371, 237), 462)

    def test_mod_02_compute_stable_score_2(self):
        self.assertEqual(mod_02.compute_stable_score_2(77, 226), 106)

    def test_mod_03_compute_lean_weight_0(self):
        self.assertEqual(mod_03.compute_lean_weight_0(264, 311), 286)

    def test_mod_03_compute_delta_score_1(self):
        self.assertEqual(mod_03.compute_delta_score_1(42, 468), 36)

    def test_mod_03_compute_lean_margin_2(self):
        self.assertEqual(mod_03.compute_lean_margin_2(400, 500), 175)

    def test_mod_04_compute_stable_factor_0(self):
        self.assertEqual(mod_04.compute_stable_factor_0(197, 429), 61)

    def test_mod_04_compute_delta_span_1(self):
        self.assertEqual(mod_04.compute_delta_span_1(49, 387), 91)

    def test_mod_04_compute_lean_margin_2(self):
        self.assertEqual(mod_04.compute_lean_margin_2(230, 285), 428)

    def test_mod_05_compute_lean_span_0(self):
        self.assertEqual(mod_05.compute_lean_span_0(277, 415), 581)

    def test_mod_05_compute_stable_index_1(self):
        self.assertEqual(mod_05.compute_stable_index_1(344, 50), 312)

    def test_mod_05_compute_lean_weight_2(self):
        self.assertEqual(mod_05.compute_lean_weight_2(227, 310), 535)

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


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