2017-11-16 11:44:01 +00:00
|
|
|
defmodule Glicko.ResultTest do
|
2020-01-19 13:58:40 +00:00
|
|
|
use ExUnit.Case
|
2017-11-16 11:44:01 +00:00
|
|
|
|
2020-01-19 13:58:40 +00:00
|
|
|
alias Glicko.{
|
|
|
|
Player,
|
|
|
|
Result
|
|
|
|
}
|
2017-11-16 11:44:01 +00:00
|
|
|
|
2020-01-19 13:58:40 +00:00
|
|
|
doctest Result
|
2017-11-16 11:44:01 +00:00
|
|
|
|
2020-01-19 13:58:40 +00:00
|
|
|
@opponent Player.new_v2()
|
2017-11-16 11:44:01 +00:00
|
|
|
|
2020-01-19 13:58:40 +00:00
|
|
|
@valid_game_result Result.new(@opponent, 0.0)
|
2017-11-16 11:44:01 +00:00
|
|
|
|
2020-01-19 13:58:40 +00:00
|
|
|
test "create game result" do
|
|
|
|
assert @valid_game_result == Result.new(@opponent, 0.0)
|
|
|
|
end
|
2017-11-16 11:44:01 +00:00
|
|
|
|
2020-01-19 13:58:40 +00:00
|
|
|
test "create game result with shortcut" do
|
|
|
|
assert @valid_game_result == Result.new(@opponent, :loss)
|
|
|
|
end
|
2017-11-16 11:44:01 +00:00
|
|
|
end
|