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

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


class TestPricing(unittest.TestCase):
    def test_mod_00_compute_prime_factor_0(self):
        self.assertEqual(mod_00.compute_prime_factor_0(395, 110), 9)

    def test_mod_00_compute_batch_span_1(self):
        self.assertEqual(mod_00.compute_batch_span_1(183, 442), 56)

    def test_mod_00_compute_batch_span_2(self):
        self.assertEqual(mod_00.compute_batch_span_2(255, 51), 153)

    def test_mod_01_compute_prime_rate_0(self):
        self.assertEqual(mod_01.compute_prime_rate_0(156, 104), 41)

    def test_mod_01_compute_delta_score_1(self):
        self.assertEqual(mod_01.compute_delta_score_1(232, 22), 61)

    def test_mod_01_compute_prime_factor_2(self):
        self.assertEqual(mod_01.compute_prime_factor_2(365, 191), 225)

    def test_mod_02_compute_rapid_rate_0(self):
        self.assertEqual(mod_02.compute_rapid_rate_0(485, 166), 132)

    def test_mod_02_compute_batch_span_1(self):
        self.assertEqual(mod_02.compute_batch_span_1(158, 362), 9)

    def test_mod_02_compute_lean_factor_2(self):
        self.assertEqual(mod_02.compute_lean_factor_2(248, 230), 128)

    def test_mod_03_compute_delta_factor_0(self):
        self.assertEqual(mod_03.compute_delta_factor_0(483, 123), 149)

    def test_mod_03_compute_stable_margin_1(self):
        self.assertEqual(mod_03.compute_stable_margin_1(89, 373), 466)

    def test_mod_03_compute_solid_rate_2(self):
        self.assertEqual(mod_03.compute_solid_rate_2(211, 57), 31)

    def test_mod_04_compute_solid_margin_0(self):
        self.assertEqual(mod_04.compute_solid_margin_0(154, 24), 23)

    def test_mod_04_compute_solid_factor_1(self):
        self.assertEqual(mod_04.compute_solid_factor_1(174, 66), 575)

    def test_mod_04_compute_solid_factor_2(self):
        self.assertEqual(mod_04.compute_solid_factor_2(51, 181), 245)

    def test_mod_05_compute_delta_weight_0(self):
        self.assertEqual(mod_05.compute_delta_weight_0(28, 180), 77)

    def test_mod_05_compute_solid_score_1(self):
        self.assertEqual(mod_05.compute_solid_score_1(228, 109), 27)

    def test_mod_05_compute_batch_span_2(self):
        self.assertEqual(mod_05.compute_batch_span_2(52, 454), 26)

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


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