Ejemplo n.º 1
0
        public void ExtractXmlFromOfx_OnInvalidOfx_ThrowException()
        {
            //Arrange
            string       input1 = File.ReadAllText(@"..\..\..\TestFiles1\Ofx_Invalid_1.OFX");
            OfxExtractor repo   = new OfxExtractor();

            //Act
            string output = repo.ExtractXmlFromOfx(input1);
        }
Ejemplo n.º 2
0
        public void ExtractXmlFromOfx_OnValidOfx_ReturnValidXml()
        {
            //Arrange
            string input1  = File.ReadAllText(@"..\..\..\TestFiles1\Ofx_Valid_1.OFX");
            string output1 = File.ReadAllText(@"..\..\..\TestFiles1\Xml_Valid_1.XML");

            //Act
            OfxExtractor repo   = new OfxExtractor();
            string       output = repo.ExtractXmlFromOfx(input1);

            //Assert
            Assert.AreEqual(output1, output);
        }
Ejemplo n.º 3
0
        public void ExtractXmlFromOfx_OnInvalidOfx_ThrowCorrectExceptionMessage()
        {
            //Arrange
            string       input1 = File.ReadAllText(@"..\..\..\TestFiles1\Ofx_Invalid_1.OFX");
            OfxExtractor repo   = new OfxExtractor();

            //Act
            try
            {
                string output = repo.ExtractXmlFromOfx(input1);
            }

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