Add unit tests for algorithms.