aboutsummaryrefslogtreecommitdiff
path: root/learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl
diff options
context:
space:
mode:
Diffstat (limited to 'learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl')
-rw-r--r--learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl b/learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl
new file mode 100644
index 0000000..d689f67
--- /dev/null
+++ b/learn-you-some-erlang/processquest/apps/processquest-1.0.0/test/pq_market_tests.erl
@@ -0,0 +1,15 @@
+-module(pq_market_tests).
+-include_lib("eunit/include/eunit.hrl").
+
+best_smallest_weapon_test_() ->
+ [?_assertMatch({<<"plastic knife">>, 0, 1, 3}, pq_market:weapon(0, 5)),
+ ?_assertMatch({<<"plastic knife">>, 1, 1, 5}, pq_market:weapon(1, 100)),
+ ?_assertMatch(undefined, pq_market:weapon(0,0)),
+ ?_assertMatch(undefined, pq_market:weapon(50000,100000000000000000000))].
+
+best_smallest_gear_test_() ->
+ [[?_assertMatch({<<"wool">>, 0, 1, 25}, pq_market:F(0, 35)),
+ ?_assertMatch({<<"pleather">>, 0, 2, 45}, pq_market:F(1, 100)),
+ ?_assertMatch(undefined, pq_market:F(0,0)),
+ ?_assertMatch(undefined, pq_market:F(50000,100000000000000000000))]
+ || F <- [helmet, shield, armor]].