public async Task GetByIdAsync_CreateAndGet_TagReturned()
        {
            // Arrage
            var tag     = _fixure.Create <Tag>();
            var created = await _repository.TryCreateAsync(tag, _userId);

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

            // Assert
            result.Should().BeEquivalentTo(created, opt => opt.WithStrictOrdering());
        }
        public async Task <TagsDomainModel> GetTagByIdAsync(int id)
        {
            var data = await _tagsRepository.GetByIdAsync(id);

            if (data == null)
            {
                return(null);
            }

            TagsDomainModel domainModel = new TagsDomainModel
            {
                Id   = data.Id,
                Name = data.Name
            };

            return(domainModel);
        }
Beispiel #3
0
 public Task <Tag> GetByIdAsync(Guid id, string userId)
 {
     return(_tagsRepository.GetByIdAsync(id, userId));
 }