test: add test for server
This commit is contained in:
parent
222968c495
commit
c174e5b703
1 changed files with 14 additions and 0 deletions
14
test/todo/server_test.exs
Normal file
14
test/todo/server_test.exs
Normal file
|
@ -0,0 +1,14 @@
|
|||
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
|
Loading…
Reference in a new issue