Added more entity functionality unit tests.
Refactored functionality tests using a helper function.