Ejemplo n.º 1
0
        /// <summary> <see cref="IDependentDomain.DeleteAsync"/> </summary>
        /// <exception cref="ArgumentNullException"><paramref name="domainModel"/> is <see langword="null"/></exception>
        public async Task <DependentDomainModel> DeleteAsync(Guid id)
        {
            if (id == Guid.Empty)
            {
                throw new ArgumentNullException(nameof(id));
            }

            var deleted = await _repository.DeleteAsync(id).ConfigureAwait(false);

            var deletedDomainModel = ToModel <DependentDomainModel, Dependent>(deleted);

            return(deletedDomainModel);
        }
        public void DeleteAsync_WithNullDependentParameter_ReturnArgumentNullException()
        {
            Func <Task> act = () => _repository.DeleteAsync(Guid.Empty);

            act.Should().Throw <ArgumentNullException>();
        }