public void StatementsAreSaved() { var statement = new List <string>().AsEnumerable(); var target = new DkbCreditcardStatementConverter(); target.LoadStatements(statement); Assert.NotNull(target); Assert.Equal(statement, target.InputStatements); }
public void ConfidenceIsHundred() { 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); Assert.Equal(100f, target.GetConfidence()); }
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); }
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); }
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); }
public void StatementIsNullNoStatementIsSaved() { var target = new DkbCreditcardStatementConverter(); Assert.Throws <ArgumentNullException>(() => target.LoadStatements(null)); }
public void DkbCreditcardStatementConverter() { var converter = new DkbCreditcardStatementConverter(); converter.LoadStatements(Statements); }