public void AddTransactionRange_NoTransactions_NothingAdded() { var account = new Account(); var transactions = new List<Transaction>(); account.AddTransactionRange(transactions); CollectionAssert.IsEmpty(account.Transactions); }
public void AddTransaction_CalledTwiceWithSameTransaction_AddsTransactionOnce() { var account = new Account(); var transactions = new List<Transaction> { new Transaction() }; account.AddTransaction(transactions[0]); account.AddTransaction(transactions[0]); CollectionAssert.AreEqual(transactions, account.Transactions); }
public void AddTransactionRange_TwoValidTransactions_AddsTwoTransactions() { var account = new Account(); var transactions = new List<Transaction> { new Transaction(), new Transaction() }; account.AddTransactionRange(transactions); CollectionAssert.AreEquivalent(transactions, account.Transactions); }
public void AddTransactionRange_TransactionAlreadyAdded_NotAdded() { var account = new Account(); var transactions = new List<Transaction> { new Transaction() }; account.AddTransaction(transactions[0]); account.AddTransactionRange(transactions); CollectionAssert.AreEquivalent(transactions, account.Transactions); }
public void CurrentFilterItem_WhenSet_AddFilteredTransactions() { var account1 = new Account(); var account2 = new Account(); var transactions = new List<Transaction> { new Transaction { Account = account1 }, new Transaction { Account = account2 } }; TransactionListViewModel viewModel = CreateTransactionListViewModel(transactions); viewModel.CurrentFilterItem = new TransactionFilterItemViewModel { Account = account1 }; Assert.AreEqual(transactions.First(), viewModel.Transactions.Single().Model); }
public void AddTransaction_ValidTransaction_AddsTransaction() { var account = new Account(); var transactions = new List<Transaction> { new Transaction() }; account.AddTransaction(transactions[0]); CollectionAssert.AreEqual(transactions, account.Transactions); }
public void AddTransaction_CalledWithNull_NothingAdded() { var account = new Account(); account.AddTransaction(null); CollectionAssert.IsEmpty(account.Transactions); }