public async Task GetWalletAsync_GetWallet_WalletReturned() { SetupMocksGet <Wallet, WalletDto>(fixture.DefaultUser, fixture.DefaultWalletDto, fixture.DefaultWallet); var wallet = await service.GetWalletAsync(fixture.DefaultUser.UserId, fixture.DefaultWalletDto.WalletId); Assert.Equal(wallet, fixture.DefaultWalletDto); VerifyMockGetWallet(fixture.DefaultWalletDto.WalletId, Times.Once()); MockMapper.Verify(x => x.Map <WalletDto>(fixture.DefaultWallet), Times.Once); }
public async Task <IActionResult> ShowWalletAsync(int id) { var walletDto = await walletService.GetWalletAsync(GetUserId(), id); if (walletDto == null) { return(NotFound()); } return(Ok(Mapper.Map <Wallet>(walletDto))); }