unit tests for dispatcher and worker