public void OpenOFXFileTest() { OFXFileReader ofxFileReader = new OFXFileReader(this._settings); OFXDocument fileContent = ofxFileReader.Read(Path.Combine(this._settings.OFXFileDirectory, FILE_NAME)); Assert.NotNull(fileContent); Assert.NotNull(fileContent.OFXTransactionCollection); Assert.False(string.IsNullOrEmpty(fileContent.ACCTID)); Assert.False(string.IsNullOrEmpty(fileContent.BANKID)); }
public int Post([FromForm] IFormFile file) { try { var newAccount = OFXFileReader.ReadFile(file); return(AccountModel.ImportAccountData(newAccount)); } catch (Exception) { throw new System.Exception("File format error!"); } }
private async Task <OFXEntity> ReadFile(Stream stream) { return(await OFXFileReader.ReadFile(stream)); }