Added tests for the dispatching functionality