parameter_test.exs 755 Bytes
Newer Older
Jens-Christian Fischer's avatar
Jens-Christian Fischer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
defmodule ParameterTest do

  use ExUnit.Case, async: true

  alias Grengine.Parameter



  describe "populated Parameter" do

    setup do
        {:ok, parameter} = Parameter.start_link("foo")
        {:ok, parameter: parameter}
    end

    test "represents string", %{parameter: parameter} do
        assert Parameter.to_string(parameter) == "(name:foo: none)"
    end

    test "set a value", %{parameter: parameter} do
      Parameter.set_value(parameter, 42)
      assert Parameter.value(parameter) == 42
    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