Write basic unit test. Closes #676