Added unit tests for controller

Added unit tests for controller