fix SimpleFactory invoke bug add test Factory