elixir-todo-list/test/todo/server_test.exs

14 lines
378 B
Elixir

defmodule Todo.TestServer do
use ExUnit.Case
alias Todo.Server
test "simple usage" do
{:ok, pid} = Server.start()
assert [] = Server.entries(pid, ~D[2024-08-04])
Server.add(pid, %{date: ~D[2024-08-04], title: "Write some Elixir"})
assert [%{date: ~D[2024-08-04], title: "Write some Elixir"}] =
Server.entries(pid, ~D[2024-08-04])
end
end