From 79340221eb722d617c3e0da2060c0983f982eb30 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Sat, 6 Jul 2024 11:46:24 -0400 Subject: [PATCH] Add tests --- test/chronoscope/nts/client_test.exs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/chronoscope/nts/client_test.exs b/test/chronoscope/nts/client_test.exs index f092704..b478248 100644 --- a/test/chronoscope/nts/client_test.exs +++ b/test/chronoscope/nts/client_test.exs @@ -38,6 +38,23 @@ defmodule Chronoscope.NTS.ClientTest do assert Client.handle_call(:list, nil, %{state: true}) == {:reply, %{state: true}, %{state: true}} 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 assert Client.handle_call(:key_establishment, nil, %{ server: %{host: "localhost", port: 3333},