Ejemplo n.º 1
0
        public async Task DeleteAsync_CreateAndDelete_LockDeleted()
        {
            // Arrage
            var @lock   = _fixure.Create <Locks.Entities.Lock>();
            var created = await _repository.TryCreateAsync(@lock, _userId);

            // Act
            var result = await _repository.DeleteAsync(created.Id, _userId);

            // Assert
            result.Should().BeTrue();
        }
Ejemplo n.º 2
0
        public async Task <bool> DeleteAsync(Lock @lock, string userId)
        {
            var deleted = await _locksRepository.DeleteAsync(@lock.Id, userId);

            if (deleted)
            {
                await _eventPublisher.SendLockDeletedMessageAsync(@lock, userId).ConfigureAwait(false);
            }

            return(deleted);
        }