I am new to elixir and trying to learn some of it's features including the testing library ExUnit, but I am having some trouble understanding the concept of how to write and setup a test for a particular function and if I am going in the correct direction.
For example, to test if a list is ordered after getting data fr om a CSV file, would I need to actually call the function I wrote that does this or just provide a mock list of unordered data?
//Module function that parses the CSV file
def parse_csv do
@csv_path
|> Path.expand(__DIR__)
|> File.stream!
|> CSV.decode
|> CSV_MODULE.prioritize_claims
end
Do I need to actually import that module function into my test file and then actually invoke it or do I just provide a sample test list that is unordered then pass the list to the function that is suppose to sort it.