public void Create_And_Store_A_Deposit_Transaction()
        {
            transactionRepository.AddDeposit(100);

            List <Transaction> transactions = transactionRepository.AllTransactions();

            Assert.AreEqual(1, transactions.Count);
            Assert.AreEqual(transactions.First(), new Transaction(TODAY, 100));
        }
Exemplo n.º 2
0
        public void Create_And_Store_A_Deposit_Transaction()
        {
            transactionRepository.AddDeposit(100);

            var transactions = transactionRepository.AllTransactions();

            transactions.Count.Should().Equals(1);
            transactions.First().Should().BeEquivalentTo(new Transaction(TODAY, 100));
        }
Exemplo n.º 3
0
        public void CreateAndStoreADepositTransaction(int amount)
        {
            transactionRepository.AddDeposit(amount);
            var transactions = transactionRepository.AllTransactions();

            Assert.Equal(1, transactions.Count);
            Assert.Equal(Transaction(_date, amount).Date, transactions[0].Date);
            Assert.Equal(Transaction(_date, amount).Amount, transactions[0].Amount);
        }
Exemplo n.º 4
0
        public void Add_a_deposit()
        {
            var transactionRepository =
                new TransactionRepository();

            transactionRepository.AddDeposit(new Transaction(500, DateTime.Today));

            Assert.That(transactionRepository.GetTransactions().Contains(
                            new Transaction(500, DateTime.Today)));
        }
Exemplo n.º 5
0
        public void AddDeposit_CreatesANewDeposit()
        {
            _dateTimeProviderMock.SetupGet(d => d.FormattedCurrentDate).Returns("01/01/2020");

            _transactionRepository.AddDeposit(100);

            var transactions = _transactionRepository.GetAll();

            Assert.Single(transactions);
            Assert.Equal(100, transactions[0].Amount);
            Assert.Equal("01/01/2020", transactions[0].Date);
        }
        public void Create_And_Store_A_Transaction()
        {
            // Arrange

            // Act
            _transactionRepository.AddDeposit(100);

            // Assert
            var transactions = _transactionRepository.GetAllTransactions();

            Assert.That(transactions.Count, Is.EqualTo(1));
            Assert.That(transactions.First(), Is.EqualTo(Transaction("12/05/2015", 100)));
        }
Exemplo n.º 7
0
        public void AddTransaction(int accountId)
        {
            Transaction transaction = new Transaction();

            if (IsDeposit)
            {
                transaction = TransactionFactory.CreateTransaction(Ammount, $"deposit");
                _transactionRepository.AddDeposit(transaction, accountId);
            }
            else if (IsWithdrawal)
            {
                transaction = TransactionFactory.CreateTransaction(Ammount, $"withdrawal");
                _transactionRepository.AddWithdrawal(transaction, accountId);
            }
            else
            {
                transaction = TransactionFactory.CreateTransaction(Ammount, AccountOfRecipient, Vs, Ks, Ss, MessageForRecipient);
                _transactionRepository.AddTransaction(transaction, accountId);
            }
        }
Exemplo n.º 8
0
 public void Deposit(int amount)
 {
     _transactionRepository.AddDeposit(amount);
 }