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

19 lines
532 B
Elixir

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