Guest User

Untitled

a guest
Feb 21st, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1.  
  2.  
  3. require 'test/unit'
  4. require 'testing'
  5.  
  6. class Teste_calc < Test::Unit::TestCase
  7. def setup
  8. @calc = Calculadora.new
  9. end
  10. def test_soma
  11. assert_equal(2, @calc.soma(1,1),"1 + 2 = 2")
  12. end
  13. def test_subtrai
  14. assert_equal(3,@calc.subtrai(7,4),"7 - 4 = 3")
  15. assert_equal(-3,@calc.subtrai(4,7),"4 - 7 = -3")
  16. end
  17. def test_multiplica
  18. assert_equal(4,@calc.multiplica(2.2),"2 X 2 = 4")
  19. end
  20. def test_divide
  21. assert_equal(2,@calc.divide(4,2),"4/2=2 ")
  22. end
  23.  
  24. def banana
  25. puts "bla"
  26. end
  27.  
  28. def teardown
  29. @calc = nil
  30. end
  31. end
Add Comment
Please, Sign In to add comment