Esempio n. 1
0
        public async Task BuyItemsToUser(List <Item> items, User user)
        {
            var totalCost = 0;

            foreach (var item in items)
            {
                await _userDao.AddUserItem(item, user);

                totalCost += item.Cost;
            }

            await _userDao.UpdateUserPoints(user, user.Point - totalCost,
                                            user.TotalPointsUsedToBet);
        }
Esempio n. 2
0
 public void AssertThatAddUserItemIsCalled()
 {
     _userDao.AddUserItem(new Item(), _user);
     _collection.Received().UpdateOneAsync(Arg.Any <ExpressionFilterDefinition <User> >(),
                                           Arg.Any <UpdateDefinition <User> >());
 }