Created
January 1, 2011 14:39
-
-
Save edipofederle/761783 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
| require "test/unit" | |
| require "fatorial.rb" | |
| class TestLibraryFileName < Test::Unit::TestCase | |
| def test_simples_cases | |
| assert_equal(120, fatorial(5)) | |
| assert_equal(6, fatorial(3)) | |
| end | |
| def test_negative_numbers | |
| assert_raise(ArgumentError) {fatorial(-1)} | |
| end | |
| def test_invalid_argument_type | |
| assert_raise(TypeError) {fatorial("a")} | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment