class ProgramaTest(unittest.TestCase):
    def setUp(self):

        self.progr = Programa("un_programa")
        self.instr = Instruccion('Instruccion 1')
    #Action
        self.progr.agregarInstruccion(self.instr)

    def test_agregarInstruccionCompararTamanho(self):
    #Assert
        self.assertEquals(1, len(self.progr.getInstrucciones()))

    def test_agregarInstruccionCompararElementos(self):
    #Assert
        self.assertEquals(self.progr.getElemento(0), self.instr)

    def test_instruccionesOrdenadasEnOutput(self):
        self.progr.ejecutar()
     #Assert
        self.assertEquals('Instruccion 1', self.progr.getInstruccionEjecutada(0))
Example #2
0
class ProgramaTest(unittest.TestCase):
    def setUp(self):

        self.progr = Programa("un_programa")
        self.instr = Instruccion('Instruccion 1')
        #Action
        self.progr.agregarInstruccion(self.instr)

    def test_agregarInstruccionCompararTamanho(self):
        #Assert
        self.assertEquals(1, len(self.progr.getInstrucciones()))

    def test_agregarInstruccionCompararElementos(self):
        #Assert
        self.assertEquals(self.progr.getElemento(0), self.instr)

    def test_instruccionesOrdenadasEnOutput(self):
        self.progr.ejecutar()
        #Assert
        self.assertEquals('Instruccion 1',
                          self.progr.getInstruccionEjecutada(0))
Example #3
0
    def setUp(self):

        self.progr = Programa("un_programa")
        self.instr = Instruccion('Instruccion 1')
        #Action
        self.progr.agregarInstruccion(self.instr)
    def setUp(self):

        self.progr = Programa("un_programa")
        self.instr = Instruccion('Instruccion 1')
    #Action
        self.progr.agregarInstruccion(self.instr)