adde player_test

parent 95cb3cfe
%{"fs": {:hex, :fs, "2.12.0", "ad631efacc9a5683c8eaa1b274e24fa64a1b8eb30747e9595b93bec7e492e25e", [:rebar3], []},
"mix_test_watch": {:hex, :mix_test_watch, "0.3.3", "70859889a8d1d43d1b75d69d87258a301f43209a17787cdb2bd9cab42adf271d", [:mix], [{:fs, "~> 2.12", [hex: :fs, optional: false]}]}}
defmodule PlayerTest do
use ExUnit.Case, async: true
doctest GrainsEngine.Player
alias GrainsEngine.Player
describe "populated Player" do
setup do
{:ok, player} = Player.start_link("frank", ["foo", "bar"])
{:ok, player: player}
end
test "represents string", %{player: player} do
assert Player.to_string(player) == "%Player{:name => frank,\n:grain => {bar, foo}}"
end
test "set all values for the player", %{player: player} do
values = %{foo: 1, bar: 2}
Player.update_parameters(player, values)
assert Player.get_values(player) == %{bar: 2, foo: 1}
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment