37:674e9537b6ab
Anton Shestakov <engored@ya.ru>, Mon, 03 Mar 2014 20:06:02 +0900
Move #state record definition to rps_rules.hrl.

next change 39:1cda561a868f
previous change 34:19dac34d9a51

test/rps3_tests.erl

Permissions: -rw-r--r--

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