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

20 lines
532 B
Elixir
Raw Normal View History

2024-08-04 13:21:15 +02:00
defmodule Todo.TestCSVImporter do
use ExUnit.Case
alias Todo.CSVImporter
alias Todo.List
test "simple correct csv" do
file_path = Path.join(__DIR__, "./files/todo_list.csv")
list = CSVImporter.import(file_path)
assert [
%{date: ~D[2024-12-19], title: "Dentist"},
%{date: ~D[2024-12-19], title: "Movies"}
] = List.entries(list, ~D[2024-12-19])
assert [
%{date: ~D[2024-12-20], title: "Shopping"}
] = List.entries(list, ~D[2024-12-20])
end
end