public void Fill(CreateAccountOutput output)
        {
            if (output == null)
            {
                ViewModel = new NoContentResult();
                return;
            }

            ViewModel = new CreatedAtRouteResult("List", new { customerId = output.AccountId }, output);
        }
Exemplo n.º 2
0
        public async Task Execute(CloseAccountInput input)
        {
            IAccount account = await _accountRepository.Get(input.AccountId);

            if (account == null)
            {
                _outputHandler.Error($"The account {input.AccountId} does not exist or is already closed.");
                return;
            }

            if (account.IsClosingAllowed())
            {
                await _accountRepository.Delete(account);
            }

            var output = new CreateAccountOutput(account);

            _outputHandler.Default(output);
        }
Exemplo n.º 3
0
        private void AssumeUseCaseRun()
        {
            var createAccountOutput = new CreateAccountOutput(Guid.NewGuid(), "Account 1", 0);

            _mockCreateAccountUseCase.Setup(x => x.Run(It.IsAny <string>())).ReturnsAsync(createAccountOutput);
        }
 public void Default(CreateAccountOutput output)
 {
     ViewModel = new OkResult();
 }
 public CloseAccountResponse(CreateAccountOutput output)
 {
     AccountId = output.AccountId;
 }