Add tests

This commit is contained in:
Mike Cifelli 2024-07-06 11:46:24 -04:00
parent fbd29d3946
commit 79340221eb
Signed by: mike
GPG Key ID: 6B08C6BE47D08E4C
1 changed files with 17 additions and 0 deletions

View File

@ -38,6 +38,23 @@ defmodule Chronoscope.NTS.ClientTest do
assert Client.handle_call(:list, nil, %{state: true}) == {:reply, %{state: true}, %{state: true}} assert Client.handle_call(:list, nil, %{state: true}) == {:reply, %{state: true}, %{state: true}}
end end
test ":auto_refresh" do
assert {:reply, :ok, %{server: true, timer: _timer}} = Client.handle_call(:auto_refresh, nil, %{server: true})
end
test ":auto_refresh - already activated" do
assert Client.handle_call(:auto_refresh, nil, %{server: true, timer: true}) ==
{:reply, :already_started, %{server: true, timer: true}}
end
test ":cancel_auto_refresh" do
assert Client.handle_call(:cancel_auto_refresh, nil, %{server: true, timer: true}) == {:reply, :ok, %{server: true}}
end
test ":cancel_auto_refresh - already cancelled" do
assert Client.handle_call(:cancel_auto_refresh, nil, %{server: true}) == {:reply, :already_cancelled, %{server: true}}
end
test ":key_establishment - cached" do test ":key_establishment - cached" do
assert Client.handle_call(:key_establishment, nil, %{ assert Client.handle_call(:key_establishment, nil, %{
server: %{host: "localhost", port: 3333}, server: %{host: "localhost", port: 3333},