Added unit tests for factoryactor