I'm afraid we can't declared it inside the function, since in unittest, the global one should be used in Application::Create() function, so we need to override the global registry object.