mirror of
https://github.com/avitex/elixir-glicko
synced 2025-04-18 13:49:57 +00:00
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.
23 lines
403 B
Elixir
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
|