43:a8365c989b1c
Anton Shestakov <engored@ya.ru>, Thu, 06 Mar 2014 19:38:46 +0900
Get win stats by nicknames, not pids.

next change 52:d9139e36aa28
previous change 42:82a465d8a5c1

test/rps5_tests.erl

Permissions: -rw-r--r--

Other formats: Feeds:
-module(rps5_tests).
-include_lib("eunit/include/eunit.hrl").
get_hands_test() ->
?assertEqual(5, length(rps5:get_hands())).
winning_hand_test() ->
?assertEqual(paper, rps5:winning_hand([rock, paper])),
?assertEqual(scissors, rps5:winning_hand([paper, scissors])),
?assertEqual(rock, rps5:winning_hand([scissors, rock])),
?assertEqual(rock, rps5:winning_hand([rock, rock, rock])),
?assertEqual(undefined, rps5:winning_hand([rock, paper, scissors])),
?assertEqual(paper, rps5:winning_hand([rock, paper, paper])),
?assertEqual(paper, rps5:winning_hand([rock, rock, paper])).