better use of the API in unit tests