Esempio n. 1
0
        public void ExtractBankTransactionsFromXml_OnInvalidXml_ThrowException()
        {
            //Arrange
            string input1 = File.ReadAllText(@"..\..\..\TestFiles1\Xml_Invalid_1.XML");
            List <BankTransaction> txnList = new List <BankTransaction>();
            OfxExtractor           repo    = new OfxExtractor();

            //Act
            List <BankTransaction> output1 = repo.ExtractBankTransactionsFromXml(input1).ToList();
        }
Esempio n. 2
0
        public void ExtractBankTransactionsFromXml_OnValidXml_ReturnTxnList()
        {
            //Arrange
            string input1 = File.ReadAllText(@"..\..\..\TestFiles1\Xml_Valid_1.XML");

            //Act
            OfxExtractor           repo    = new OfxExtractor();
            List <BankTransaction> output1 = repo.ExtractBankTransactionsFromXml(input1).ToList();

            //Assert
            CollectionAssert.AreEqual(_bankTransactionList1, output1, new BankTransactionComparer());
        }
Esempio n. 3
0
        public void ExtractBankTransactionsFromXml_OnInvalidXml_ThrowCorrectExceptionMessage()
        {
            //Arrange
            string       input1 = File.ReadAllText(@"..\..\..\TestFiles1\Xml_Invalid_1.XML");
            OfxExtractor repo   = new OfxExtractor();

            //Act
            try
            {
                List <BankTransaction> output1 = repo.ExtractBankTransactionsFromXml(input1).ToList();
            }

            //Assert
            catch (Exception ex)
            {
                Assert.AreEqual("Badly formatted XML string", ex.Message);
            }
        }