class TestCase(unittest.TestCase): def setUp(self): self.cal = Figuras() def test_usuario0(self): self.assertEqual(4, self.cal.cuadrado(2)) def test_usuario01(self): self.assertEqual( 18.847850000000005, self.cal.circulo(2.45)) def test_usuario1(self): self.assertEqual(2, self.cal.rectangulo(2, 1)) def test_usuario2(self): self.assertEqual(5, self.cal.triangulo(2, 5)) def test_usuario3(self): self.assertEqual(8, self.cal.rombo(2, 8)) def test_usuario4(self): self.assertEqual(25, self.cal.cuadrado(5)) def test_usuario5(self): self.assertEqual(12.56, self.cal.circulo(2)) def test_usuario6(self): self.assertEqual(14, self.cal.rectangulo(2, 7)) def test_usuario7(self): self.assertEqual(3, self.cal.triangulo(2, 3)) def test_usuario8(self): self.assertEqual(8, self.cal.rombo(2, 8)) def test_usuario9(self): self.assertEqual(4, self.cal.cuadrado(2)) def test_usuario10(self): self.assertEqual(113.04, self.cal.circulo(6)) def test_usuario11(self): self.assertEqual(4, self.cal.rectangulo(2, 2)) def test_usuario12(self): self.assertEqual(8, self.cal.triangulo(2, 8)) def test_usuario13(self): self.assertEqual(4, self.cal.rombo(2, 4))
def when_i_compute_its_figure(step): f=Figuras() if(world.escenario==0): world.number = f.cuadrado(world.number) elif(world.escenario==1): world.number = f.circulo(world.number) elif(world.escenario==2): world.number = f.rombo(world.number,world.base) elif(world.escenario==3): world.number = f.triangulo(world.number,world.base) else: world.number = f.rectangulo(world.number,world.base)
def test_area_circulo(self): fig=Figuras() self.assertEqual(12.5664,fig.circulo(2))
def test_area_circulo4(self): fig=Figuras() self.assertEqual(50.2656,fig.circulo(4))
def test_area_circulo3(self): fig=Figuras() self.assertEqual(28.2744,fig.circulo(3))
class TestCase(unittest.TestCase): def test_usuario(self): self.cal = Figuras() self.assertEqual(4, self.cal.cuadrado(2)) def test_usuario(self): self.cal = Figuras() self.assertEqual(6, self.cal.circulo(2.45)) def test_usuario1(self): self.cal = Figuras() self.assertEqual(2, self.cal.rectangulo(2, 1)) def test_usuario2(self): self.cal = Figuras() self.assertEqual(5, self.cal.triangulo(2, 5)) def test_usuario3(self): self.cal = Figuras() self.assertEqual(12, self.cal.rombo(2, 8)) def test_usuario4(self): self.cal = Figuras() self.assertEqual(25, self.cal.cuadrado(5)) def test_usuario5(self): self.cal = Figuras() self.assertEqual(9, self.cal.circulo(2)) def test_usuario6(self): self.cal = Figuras() self.assertEqual(14, self.cal.rectangulo(2, 7)) def test_usuario7(self): self.cal = Figuras() self.assertEqual(4, self.cal.triangulo(2, 3)) def test_usuario8(self): self.cal = Figuras() self.assertEqual(8, self.cal.rombo(2, 8)) def test_usuario9(self): self.cal = Figuras() self.assertEqual(6, self.cal.cuadrado(2)) def test_usuario10(self): self.cal = Figuras() self.assertEqual(13, self.cal.circulo(6)) def test_usuario11(self): self.cal = Figuras() self.assertEqual(4, self.cal.rectangulo(2, 2)) def test_usuario12(self): self.cal = Figuras() self.assertEqual(8, self.cal.triangulo(2, 8)) def test_usuario13(self): self.cal = Figuras() self.assertEqual(4, self.cal.rombo(2, 4))
def test_circulo_1(self): fig = Figuras() self.assertEqual(3.1416, fig.circulo(1))
def test_circulo_2(self): fig = Figuras() self.assertEqual(12.5664, fig.circulo(2))
def test_circulo_5(self): fig = Figuras() self.assertEqual(78.53999999999999, fig.circulo(5))
def test_circulo_1(self): fig = Figuras() self.assertEqual(3.1416,fig.circulo(1))
def test_circulo_5(self): fig = Figuras() self.assertEqual(78.53999999999999,fig.circulo(5))