How to load a dataset from a text file for unit tests?

I have collected some data. However, it's too long to paste into a line. How to load from a text file or JSON file .etc?