Add unit tests

Signed-off-by: Connor Yan <126ium@gmail.com>