public void Parse_Should_Parse()
        {
            //Given
            var extrato1OfxDocment = Path.Combine(Environment.CurrentDirectory, "extrato1.ofx");
            var ofxDocumentStream  = File.OpenRead(extrato1OfxDocment);

            //When
            var ofxDocument = OfxDocumentParser.Parse(ofxDocumentStream);

            //Then
            Assert.NotNull(ofxDocument);
        }
Пример #2
0
        public ActionResult Reconcile(IFormCollection formCollection)
        {
            try
            {
                //Should be tested. IFormFileCollection should be in Core Framework?
                var ofxDocuments = new List <OfxDocument>();
                foreach (var file in formCollection.Files)
                {
                    var stream      = file.OpenReadStream();
                    var ofxDocument = OfxDocumentParser.Parse(stream);
                    ofxDocuments.Add(ofxDocument);
                }
                var bankAccount = _bankReconciliationService.ReconcileAndAddTransactions(ofxDocuments);

                return(View(nameof(Reconcile), bankAccount));
            }
            catch
            {
                return(View());
            }
        }