Example #1
0
        public void DeleteAsync_CallsRepository_WhenExistsWithId()
        {
            A.CallTo(() => _gameDecorator.AnyAsync(A <Expression <Func <GameRoot, bool> > > ._)).Returns(true);

            _gameServices.DeleteAsync(Id);

            A.CallTo(() => _gameDecorator.DeleteAsync(Id)).MustHaveHappenedOnceExactly();
        }
Example #2
0
        public async Task DeleteAsync(string id)
        {
            var exist = await _gameDecorator.AnyAsync(g => g.Id == id);

            if (!exist)
            {
                throw new EntityNotFoundException <GameRoot>(id);
            }

            await _gameDecorator.DeleteAsync(id);

            await _unitOfWork.CommitAsync();
        }