Created
December 20, 2018 13:35
-
-
Save hcosta/35da383fb2368c24d595c57b7c055afd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from calculator import Calculator | |
class TestMyCalculator(unittest.TestCase): | |
def setUp(self): | |
self.calc = Calculator() | |
def test_initial_value(self): | |
self.assertEqual(0, self.calc.value) | |
# Creamos un nuevo test para comprobar una suma | |
def test_add_method(self): | |
# Ejecutamos el método | |
self.calc.add(1, 3) | |
# Comprobamos si el valor es el que esperamos | |
self.assertEqual(4, self.calc.value) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment