Add unit/integration tests on main functions