Threesuns

Email

Contact

All Semesters

Semesters

All Courses

Courses

Ruby

CSYS2853

3 credits

Labs

Testing

Lab

100 points

Requirements

Unit Test is performed from test file10
is_tut method is tested completely20
to_tut method is tested completely35
to_english method is tested completely35
Total100 pts

Objective

To practice with Unit Testing

Instructions

For this lab you will be performing a unit test on your Tut program. If your Tut program isn't working correctly then send me an email and I'll send you my working copy.

For your Tut program you need to create five test cases:

  1. test_is_tut
  2. test_to_tut_without_block
  3. test_to_tut_with_block
  4. test_to_english_without_block
  5. test_to_english_with_block

For the test_is_tut test case you will need to perform assertions to assure that your Tut classes is_tut method correctly identifies strings as being in tut or in english. Make sure that you test "edge cases" like an empty string as well as strings that are in english and in tut. There should be at least three assertions made.

For the test_to_tut_without_block and test_to_tut_with_block test cases you should test your Tut classes to_tut method both with and without a block. Write assertions that make sure that the correct values are returned in all cases according to the last tut lab. There should be a total of at least four assertions total in these two test cases.

For the test_to_english_without_block and test_to_english_with_block test cases you should test your Tut classes to_english method both with and without a block. Write assertions that make sure that the correct values are returned in all cases according to the last tut lab. There should be a total of at least four assertions total in these two test cases.