Add unit and integration tests