Add SetPrincipalAttribute

Allows to set custom principal during test execution.
Update unit tests

More unit tests for CacheExtensions and CacheBase.