public void TestWriteTransactionDataShouldReturnEmptyStringOnNull() { var loggerMock = new Mock <ICalcFeesLogger>(); var writer = new TransactionString3ColumnWriter(loggerMock.Object); var line = writer.WriteTransactionData(null); line.ShouldBeEmpty(); }
public void TestWriteTransactionDataShouldReturnRightString() { var loggerMock = new Mock <ICalcFeesLogger>(); var writer = new TransactionString3ColumnWriter(loggerMock.Object); var transactionObject = new TransactionObject() { TransactionDate = new DateTime(2018, 1, 1), MerchantName = "Telia", TransactionPercentageFee = 2.00m }; var line = writer.WriteTransactionData(transactionObject); line.ShouldMatch("2018-01-01 Telia 2.00"); }
public void TestWriteTransactionDataShouldReturnEmptyStringOnException() { var loggerMock = new Mock <ICalcFeesLogger>(); var writer = new TransactionString3ColumnWriter(loggerMock.Object); var transactionObject = new TransactionObject() { TransactionDate = new DateTime(550, 1, 1) }; var currentCulture = Thread.CurrentThread.CurrentCulture; CultureInfo arSY = new CultureInfo("ar-SY"); arSY.DateTimeFormat.Calendar = new HijriCalendar(); Thread.CurrentThread.CurrentCulture = arSY; var line = writer.WriteTransactionData(transactionObject); line.ShouldBeEmpty(); Thread.CurrentThread.CurrentCulture = currentCulture; }