public void ParseTransactionAmountTest() { TransLogCSVParser testpasrer = new TransLogCSVParser(); var res = testpasrer.ParseTransaction(csvString1).Amount; Assert.AreEqual(1000, res); }
public void ParseTransactionStatusTest() { TransLogCSVParser testpasrer = new TransLogCSVParser(); var res = testpasrer.ParseTransaction(csvString1).Status; Assert.AreEqual(TransStatus.Approved, res); }
public void ParseTransactionTransactionIdTest() { TransLogCSVParser testpasrer = new TransLogCSVParser(); var res = testpasrer.ParseTransaction(csvString1).TransactionId; Assert.AreEqual("Invoice0000001", res); }
public void ParseTransactionDateTest() { TransLogCSVParser testpasrer = new TransLogCSVParser(); var res = testpasrer.ParseTransaction(csvString1).TransDate; Assert.AreEqual(new DateTime(2019, 02, 20, 12, 33, 16, DateTimeKind.Local), res); }
public void ParseTransactionCurrencyCodeTest() { TransLogCSVParser testpasrer = new TransLogCSVParser(); var res = testpasrer.ParseTransaction(csvString1).CurrencyCode; Assert.AreEqual("USD", res); }
public async void GetTransactionsCount1Test() { TransLogCSVParser testpasrer = new TransLogCSVParser(); var cvsFile = GetCSVFileStreeam(csvString1); IEnumerable <string> res = await testpasrer.GetTransactions(cvsFile); Assert.IsNotNull(res); Assert.AreEqual(1, res.Count()); }
public async void GetTransactionsCount2Test() { TransLogCSVParser testpasrer = new TransLogCSVParser(); var buf = new StringBuilder(2); buf.AppendLine(csvString1); buf.AppendLine(csvString2); var cvsFile = GetCSVFileStreeam(buf.ToString()); IEnumerable <string> res = await testpasrer.GetTransactions(cvsFile); Assert.IsNotNull(res); Assert.AreEqual(2, res.Count()); }
public void ParseTransactionBadFormatExpeptionTest() { TransLogCSVParser testpasrer = new TransLogCSVParser(); Assert.ThrowsException <TCGException>(() => testpasrer.ParseTransaction("..."), "ParseTransaction() - TCGException"); }
public void ParseTransactionNullTest() { TransLogCSVParser testpasrer = new TransLogCSVParser(); Assert.ThrowsException <ArgumentNullException>(() => testpasrer.ParseTransaction(null), "ParseTransaction() - ArgumentNullException"); }
public void TestGetSupportedFileType() { TransLogCSVParser testpasrer = new TransLogCSVParser(); Assert.AreEqual(testpasrer.GetSupportedFileType(), "CSV"); }