=begin This file supports a test-driven approach to programming. It was set up first, before actually programming the fact method. It provides a type of template for doing test-driven programming for any problem. =end require 'test/unit' #this never changes require 'iFactorial0.rb' #file where fact method is found class FactorialTest < Test::Unit::TestCase #FactorialTest is name of your choosing def test_fact_0 #test_fact_0 is name of your choosing s = fact(0) #fact is method we are testing with parameter 0 assert_equal(1, s) #we expect the return value to be 1, i.e., 0! == 1 end def test_fact_1 s = fact(1) assert_equal(1, s) end def test_fact_2 s = fact(2) assert_equal(2, s) end def test_fact_3 s = fact(3) assert_equal(6, s) end def test_fact_4 s = fact(4) assert_equal(24, s) end #Should we have more test cases? Probably. They would follow same form #as those above. end