Exemple #1
0
        public void SuccessfullyWithdrawMoneyFromAccount()
        {
            _sourceAccount = new Account(_sourceAccountGuid, _sourceUser, 850, 150, 1000);
            SetupTestAccount();
            withdrawMoneyService.Execute(_sourceAccountGuid, 200);

            var fromAccount = _testAccountRepository.GetAccountById(_sourceAccountGuid);

            fromAccount.Balance.Should().Be(650);
        }
Exemple #2
0
        public void SuccessfullyTransferMoneyBetweenTwoAccounts()
        {
            _sourceAccount      = new Account(_sourceAccountGuid, _sourceUser, 850, 150, 1000);
            _destinationAccount = new Account(_destinationAccountGuid, _destinationUser, 2000, 300, 2300);

            SetupTestAccounts();

            transformMoneyService.Execute(_sourceAccountGuid, _destinationAccountGuid, 200);

            var fromAccount = _testAccountRepository.GetAccountById(_sourceAccountGuid);
            var toAccount   = _testAccountRepository.GetAccountById(_destinationAccountGuid);

            fromAccount.Balance.Should().Be(650);
            toAccount.Balance.Should().Be(2200);
        }