public IParserService GetParser(string fileType, string fileName = "") { if (Constants.MsReadValidFileTypes.Contains(fileType)) { if (_msreadParser == null) { _msreadParser = new MSReadParserService(_allParsersConfigs.MsRead.CognitiveServiceEndPoint, _allParsersConfigs.MsRead.CongnitiveServiceKey); } return(_msreadParser); } else if (Constants.DocxValidFileTypes.Contains(fileType)) { if (_docxParser == null) { _docxParser = new DocxParserService(); } return(_docxParser); } throw new UnsupportedFileTypeException(fileName, fileType, _validDocTypes); }
public DocxParserServiceUnitTest() { _parser = new DocxParserService(); }