コード例 #1
0
ファイル: AccountTests.cs プロジェクト: runenur/Moneyero
        public void AddTransactionRange_NoTransactions_NothingAdded()
        {
            var account = new Account();
            var transactions = new List<Transaction>();

            account.AddTransactionRange(transactions);

            CollectionAssert.IsEmpty(account.Transactions);
        }
コード例 #2
0
ファイル: AccountTests.cs プロジェクト: runenur/Moneyero
        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);
        }
コード例 #3
0
ファイル: AccountTests.cs プロジェクト: runenur/Moneyero
        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);
        }
コード例 #4
0
ファイル: AccountTests.cs プロジェクト: runenur/Moneyero
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: AccountTests.cs プロジェクト: runenur/Moneyero
        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);
        }
コード例 #7
0
ファイル: AccountTests.cs プロジェクト: runenur/Moneyero
 public void AddTransaction_CalledWithNull_NothingAdded()
 {
     var account = new Account();
     account.AddTransaction(null);
     CollectionAssert.IsEmpty(account.Transactions);
 }