Esempio n. 1
0
        public void TimeFilterWorks()
        {
            var statement = new List <string>();

            statement.Add("\"Ja\";\"22.07.2017\";\"21.07.2017\";\"HabenzinsenZ 1234567890 T 029   0000\";\"12,34\";\"\";");

            var target = new DkbCreditcardStatementConverter();

            target.LoadStatements(statement.AsEnumerable());
            Assert.NotNull(target);
            Assert.Equal(statement, target.InputStatements);
            var actual = target.GetConvertedStatements().Count();

            Assert.Equal(1, actual);
            var culture = CultureInfo.CreateSpecificCulture("de-DE");

            actual = target.GetConvertedStatements(DateTime.Parse("20.07.2017", culture)).Count();
            Assert.Equal(1, actual);
            actual = target.GetConvertedStatements(DateTime.Parse("21.07.2017", culture)).Count();
            Assert.Equal(0, actual);
        }
Esempio n. 2
0
        public void NonStatementConverted()
        {
            var statement = new List <string>();

            statement.Add("\"Umsatz abgerechnet und nicht im Saldo enthalten\";\"Wertstellung\";\"Belegdatum\";\"Beschreibung\";\"Betrag(EUR)\";\"Urspr�nglicher Betrag\";");
            var date   = DateTime.UtcNow;
            var target = new DkbCreditcardStatementConverter();

            target.LoadStatements(statement.AsEnumerable());
            Assert.NotNull(target);
            Assert.Equal(statement, target.InputStatements);

            var actual = target.GetConvertedStatements(date);

            Assert.Empty(actual);
        }
Esempio n. 3
0
        public void StatementConverted()
        {
            var statement = new List <string>();

            statement.Add("\"Ja\";\"22.07.2017\";\"21.07.2017\";\"HabenzinsenZ 123456789 T 029   0000\";\"12,34\";\"\";");
            var target = new DkbCreditcardStatementConverter();

            target.LoadStatements(statement.AsEnumerable());
            Assert.NotNull(target);
            Assert.Equal(statement, target.InputStatements);
            var actual = target.GetConvertedStatements().FirstOrDefault();

            Assert.Equal("", actual.Category);
            var culture = CultureInfo.CreateSpecificCulture("de-DE");

            Assert.Equal(DateTime.Parse("21.07.2017", culture), actual.Date);
            Assert.Equal(12.34f, actual.Inflow);
            Assert.Equal("Converted! Original: HabenzinsenZ 123456789 T 029   0000", actual.Memo);
            Assert.Equal(0.0, actual.Outflow);
            Assert.Equal("", actual.Payee);
        }