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(); }
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); }