1
0
mirror of https://github.com/avitex/elixir-glicko synced 2025-04-18 13:49:57 +00:00
glicko-elixir/test/result_test.exs
Mikael Muszynski ce08ab5e24 Convert Player (v1/v2) and Result to structs
In an effort to give names to core concepts in the library, replace the
current way of passing around tuples (of varying length and content)
with appropriately named structs.

As a consequence of creating `Player.{V1, V2}` and `Result`, a variety
of functions that extracted values out of the tuples have either been
removed or changed to access struct fields instead.
2020-02-21 22:53:28 +01:00

23 lines
403 B
Elixir

defmodule Glicko.ResultTest do
use ExUnit.Case
alias Glicko.{
Player,
Result
}
doctest Result
@opponent %Player.V2{}
@valid_game_result Result.new(@opponent, 0.0)
test "create game result" do
assert @valid_game_result == Result.new(@opponent, 0.0)
end
test "create game result with shortcut" do
assert @valid_game_result == Result.new(@opponent, :loss)
end
end