Source

CCP2011 / test_MDC.py

Full commit
"""
Modulo de teste para MDC.py
"""
from MDC import *
import unittest

class TestMDCForcaBruta(unittest.TestCase):
    def test_m_d_c_forca_bruta(self):
        a=1071
        b=462
        self.assertEqual(21, MDC_forca_bruta(a, b))
    def test_m_d_c_forca_bruta2(self):
        a=0
        b=462
        self.assertEqual(462, MDC_forca_bruta(a, b))
    def test_m_d_c_forca_bruta3(self):
        a=1071
        b=0
        self.assertEqual(1071, MDC_forca_bruta(a, b))
    def test_m_d_c_forca_bruta4(self):
        a=18
        b=84
        self.assertEqual(6, MDC_forca_bruta(a, b))

class TestMDCE(unittest.TestCase):
    def test_m_d_c__e(self):
        a=1071
        b=462
        self.assertEqual(21, MDC_E(a, b))
    def test_m_d_c__e2(self):
        a=0
        b=462
        self.assertEqual(462, MDC_E(a, b))
    def test_m_d_c__e3(self):
        a=1071
        b=0
        self.assertEqual(1071, MDC_E(a, b))
    def test_m_d_c__e4(self):
        a=18
        b=84
        self.assertEqual(6, MDC_E(a, b))

class TestMDCE_l(unittest.TestCase):
    def test_m_d_c__e__l(self):
        a=1071
        b=462
        self.assertEqual(21, MDC_E_l(a, b))
    def test_m_d_c__e__l2(self):
        a=0
        b=462
        self.assertEqual(462, MDC_E_l(a, b))
    def test_m_d_c__e__l3(self):
        a=1071
        b=0
        self.assertEqual(1071, MDC_E_l(a, b))
    def test_m_d_c__e__l4(self):
        a=18
        b=84
        self.assertEqual(6, MDC_E_l(a, b))

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