public async Task Handle_GetNonExistingAccount_ShouldReturnNotFound()
        {
            var handler = new AccountGetHandler(Mapper, _mockRepo.Object);

            _mockRepo
            .Setup(repo => repo.Account.FindById(It.Is <int>(a => a == 1), It.IsAny <List <string> >()))
            .Returns(null as Account);

            await Assert.ThrowsAsync <NotFoundException>(() => handler.Handle(new AccountGetRequest {
                AccountId = 1, CustomerId = 2
            }, default));
        }
        public async Task Handle_GetExistingAccountDifferentCustomer_ShouldReturnBusinessException()
        {
            var handler = new AccountGetHandler(Mapper, _mockRepo.Object);

            var account = GetTestAccount();
            var request = new AccountGetRequest {
                AccountId = 1, CustomerId = 2
            };

            MockRepo(account);

            await Assert.ThrowsAsync <BusinessException>(() => handler.Handle(request, default));
        }
        public async Task Handle_GetExistingAccount_ShouldReturnAccount()
        {
            var handler = new AccountGetHandler(Mapper, _mockRepo.Object);

            var account = GetTestAccount();
            var request = new AccountGetRequest {
                AccountId = 1, CustomerId = 1
            };

            MockRepo(account);

            var result = await handler.Handle(request, default);

            _mockRepo.Verify();

            Assert.IsType <AccountModel>(result);
            Assert.Equal(request.CustomerId, result.CustomerId);
            Assert.Equal(request.AccountId, result.Id);
            Assert.Equal(50, result.Balance);
        }