Added tests for singleton factory.