private async Task UpdateItemsTable(ITransactionWrapper transactionWrapper, List <DatabaseModel.Item> items, bool isDeposit) { if (isDeposit) { await _itemRepoService.InsertAsync(items, transactionWrapper); } else { await _itemRepoService.DeleteAsync(items); } }
public async Task UserWithdrawalItemsSuccess() { _offerMinmalInfo.OfferSend.SteamOffer.ItemsToReceive.Clear(); _offerMinmalInfo.OfferSend.SteamOffer.Id = "12346"; var offerTransInsertWithId = new DatabaseModel.OfferTransaction(1, 14, new decimal(196.91), false, "12346", DateTime.Today, 75); var userInsertRes = new DatabaseModel.User("userSteamId", "name", "img", "tradeLink", DateTime.Today, DateTime.Today, false, null, 1); A.CallTo(() => _fakedUserRepoService.FindAsync("userSteamId")).Returns(userInsertRes); var botLookRes = Task.FromResult(new DatabaseModel.Bot("botSteamId", "botName", 14)); A.CallTo(() => _fakedBotRepoService.FindAsync("botSteamId")).Returns(botLookRes); A.CallTo(() => _fakedOfferTranascrionRepoService.FindAsync("12346")).Returns(offerTransInsertWithId); await _offerService.WithdrawalSteamOffer(_offerMinmalInfo); A.CallTo(() => _fakedOfferTranascrionRepoService.AddAcceptedTimesptampToOffer(A <DateTime> ._, 75)).MustHaveHappened(); A.CallTo(() => _fakedItemRepoService.DeleteAsync(A <List <DatabaseModel.Item> > ._)).MustHaveHappened(); }