public void ThrowsApplicationExceptionDuringTotalAmountCalculationWhenTransactionContainsInvalidAmount() { var tp = new TransactionProcessor( new TransactionParser(TransactionTestData.InvalidTransactionLineWithInvalidAmount), string.Empty); _ = Assert.Throws <ApplicationException>( delegate { _ = tp.GetTotalAmount(); }); }
public void CalculatesTotalAmountOfAllTransactions() { decimal expectedAmount = -7.04M; var tp = new TransactionProcessor( new TransactionParser(TransactionTestData.TwoValidTransactions), string.Empty); var actual = tp.GetTotalAmount(); Assert.AreEqual(expectedAmount, actual); }