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

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


class TestBilling(unittest.TestCase):
    def test_mod_00_compute_delta_weight_0(self):
        self.assertEqual(mod_00.compute_delta_weight_0(492, 98), 21)

    def test_mod_00_compute_rapid_score_1(self):
        self.assertEqual(mod_00.compute_rapid_score_1(8, 348), 585)

    def test_mod_00_compute_batch_rate_2(self):
        self.assertEqual(mod_00.compute_batch_rate_2(406, 310), 455)

    def test_mod_01_compute_batch_score_0(self):
        self.assertEqual(mod_01.compute_batch_score_0(216, 355), 283)

    def test_mod_01_compute_lean_score_1(self):
        self.assertEqual(mod_01.compute_lean_score_1(37, 450), 150)

    def test_mod_01_compute_batch_factor_2(self):
        self.assertEqual(mod_01.compute_batch_factor_2(191, 263), 193)

    def test_mod_02_compute_lean_index_0(self):
        self.assertEqual(mod_02.compute_lean_index_0(293, 337), 76)

    def test_mod_02_compute_lean_span_1(self):
        self.assertEqual(mod_02.compute_lean_span_1(80, 493), 90)

    def test_mod_02_compute_stable_load_2(self):
        self.assertEqual(mod_02.compute_stable_load_2(146, 203), 196)

    def test_mod_03_compute_swift_rate_0(self):
        self.assertEqual(mod_03.compute_swift_rate_0(476, 316), 414)

    def test_mod_03_compute_swift_score_1(self):
        self.assertEqual(mod_03.compute_swift_score_1(159, 66), 97)

    def test_mod_03_compute_batch_factor_2(self):
        self.assertEqual(mod_03.compute_batch_factor_2(288, 399), 80)

    def test_mod_04_compute_rapid_factor_0(self):
        self.assertEqual(mod_04.compute_rapid_factor_0(217, 204), 444)

    def test_mod_04_compute_solid_score_1(self):
        self.assertEqual(mod_04.compute_solid_score_1(485, 238), 275)

    def test_mod_04_compute_rapid_factor_2(self):
        self.assertEqual(mod_04.compute_rapid_factor_2(250, 314), 292)

    def test_mod_05_compute_stable_weight_0(self):
        self.assertEqual(mod_05.compute_stable_weight_0(27, 448), 49)

    def test_mod_05_compute_solid_rate_1(self):
        self.assertEqual(mod_05.compute_solid_rate_1(272, 456), 150)

    def test_mod_05_compute_swift_weight_2(self):
        self.assertEqual(mod_05.compute_swift_weight_2(233, 34), 80)

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


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