Add unit tests for socket controller