Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.67 KB | None | 0 0
  1. # File: friend_list_tests.rb
  2. require 'friend_list'
  3. require 'test/unit'
  4.  
  5. class TestFriendList < Test::Unit::TestCase
  6.   def test_return
  7.     list = FriendList.new
  8.    
  9.     assert_equal('Paulo Soreto', list.add('Paulo Soreto'))
  10.     assert_equal('Pedro Josefino', list.add('Pedro Josefino'))
  11.     assert_equal([], list.clear)
  12.   end
  13.  
  14.   def test_methods
  15.     list = FriendList.new
  16.    
  17.     list.add('Paulo Soreto')
  18.     assert_equal(['Paulo Soreto'], list)
  19.    
  20.     list.add('Pedro Josefino')
  21.     assert_equal(['Paulo Soreto', 'Pedro Josefino'], list)
  22.    
  23.     list.remove('Paulo Soreto')
  24.     assert_equal(['Pedro Josefino'], list)
  25.    
  26.     list.clear
  27.     assert_equal([], list)
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement