Modified unittests to use mock objects.