コード例 #1
0
        public async Task CreateAsync_NotNullModel_Created()
        {
            // Arrage
            var @lock = _fixure.Create <Locks.Entities.LockTag>();

            @lock.CreatedBy = _userId;

            // Act
            var result = await _repository.TryCreateAsync(@lock, _userId);

            // Assert
            result.Should().BeEquivalentTo(@lock, opt => opt.WithStrictOrdering());
        }
コード例 #2
0
        public async Task <LockTag> CreateLink(LockTag link, string userId)
        {
            var entity = await _locksTagsRepository.TryCreateAsync(link, userId).ConfigureAwait(false);

            if (entity != null)
            {
                await _eventPublisher.SendTagLinkedMessageAsync(entity, userId).ConfigureAwait(false);
            }

            return(entity);
        }