Added more unit tests for Task and FunctorTask

* More tests were added for task.Task and task.FunctorTask
  to enhance code coverage.

Change-Id: Idacf0ee3fcb84d71cdb57d4f6d986f7e983597f0
Merge "Added more unit tests for Task and FunctorTask"