public async Task CreateWalletAsync_ValidWallet_WalletCreated()
        {
            SetupMocksCreate(fixture.DefaultUser);

            var createdWallet = await service.CreateWalletAsync(fixture.DefaultUser.UserId, fixture.DefaultWalletDto);

            Assert.Equal(createdWallet, fixture.DefaultWalletDto);
            VerifyMocksCreate(fixture.DefaultUser.UserId, Times.Once());
        }
Exemple #2
0
        public async Task <IActionResult> CreateWalletAsync(CreateWalletModel wallet)
        {
            var userId              = GetUserId();
            var walletDto           = Mapper.Map <WalletDto>(wallet);
            var createdWalletEntity = await walletService.CreateWalletAsync(userId, walletDto);

            var createdWallet = Mapper.Map <Wallet>(createdWalletEntity);

            return(CreatedAtRoute(
                       Routes.ShowWallet,
                       new { id = createdWallet.WalletId },
                       createdWallet));
        }