Created
August 2, 2011 11:34
-
-
Save craigmartin/1120032 to your computer and use it in GitHub Desktop.
Test/Unit for sum 1to100 program
This file contains 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' | |
class MathTester < Test::Unit::TestCase | |
def test_addition | |
assert_equal( 3, 1+2 ) | |
assert_equal( 5, 2+3 ) | |
end | |
def test_subtraction | |
assert_equal( 10, 20-10 ) | |
end | |
def test_multiplication | |
assert_equal( 5, 5 * 1 ) | |
end | |
def test_division | |
assert_equal( 10, 20 / 2 ) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment