41:f32e096c5433
Anton Shestakov <engored@ya.ru>, Mon, 03 Mar 2014 22:17:50 +0900
Add only unique hands to #ruleinfo.hands.

next change 52:d9139e36aa28
previous change 39:1cda561a868f

test/rps3_tests.erl

Permissions: -rw-r--r--

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