Add unit test for loader