Ejemplo n.º 1
0
        public void Test2()
        {
            var accountId = Guid.NewGuid();

            var command = new CreateNewAccountCommand(accountId);

            _newAccountCreator.Create(command);

            _cashMachine.Deposit(new MakeDepositCommand(accountId, 5000));

            var actual = _accountRetriever.Retrieve(new BankAccountStateQuery(accountId));

            IsTrue(() => actual.Id == accountId);
            IsTrue(() => actual.Balance == 5000);
        }
Ejemplo n.º 2
0
        public void FreezeAccountWithdrawalTest()
        {
            var accountId = Guid.NewGuid();

            var command = new CreateNewAccountCommand(accountId);

            _newAccountCreator.Create(command);

            _cashMachine.Deposit(new MakeDepositCommand(accountId, 5000));

            _customerServiceRepresentative.FreezeAccount(new FreezeAccountCommand(accountId));

            Assert.Throws <AccountIsFrozenException>(
                () => { _cashMachine.Withdraw(new MakeWithdrawalCommand(accountId, 2000)); });
        }