public void ReturnAStatementLineWithAGivenFormatProvider() { var transaction = new Transaction(1000m, new DateTime(2015, 9, 19)); var statementLine = new StatementLine(transaction, 1500m); Assert.AreEqual(statementLine.CreateWith(_formatProvider), " | 19/09/2015 | 1,000.00 | 1,500.00"); }
public void StoreAWithdrawal() { var transaction = new Transaction(AmountB, DateA); _clock.Today().Returns(DateA); _account.Withdraw(AmountA); _transactionRepository.Received().AddTransaction(transaction); }
public void StoreADeposit() { var transaction = new Transaction(AmountA, DateA); _clock.Today().Returns(DateA); _account.Deposit(AmountA); _transactionRepository.Received().AddTransaction(transaction); }
public void ReturnAFormattedDate() { var transaction = new Transaction(AmountA, new DateTime(2015, 9, 18)); Assert.AreEqual(transaction.FormattedDate(_formatProvider), "18/09/2015"); }
public void ReturnAFormattedAmount() { var transaction = new Transaction(AmountA, DateTime.Today); Assert.AreEqual(transaction.FormattedAmount(_formatProvider), "2,000.00"); }
public void ReturnADecimalAmount() { var transaction = new Transaction(AmountA, DateTime.Today); Assert.AreEqual(transaction.Amount(), AmountA); }
public void AddTransaction(Transaction transaction) { _transactions.Add(transaction); }
public StatementLine(Transaction transaction, decimal balance) { _transaction = transaction; _balance = balance; }
protected bool Equals(Transaction other) { return Equals(_money, other._money) && _date.Equals(other._date); }