public virtual async Task <TagDto> CreateAsync(TagCreateDto input)
        {
            var newTag = ObjectMapper.Map <TagCreateDto, Tag>(input);

            newTag.TenantId = CurrentTenant.Id;
            var tag = await _tagRepository.InsertAsync(newTag);

            await CurrentUnitOfWork.SaveChangesAsync();

            return(ObjectMapper.Map <Tag, TagDto>(tag));
        }
Beispiel #2
0
        public async Task CreateAsync()
        {
            // Arrange
            var input = new TagCreateDto
            {
                Name = "40cfea20f3034ca7890cb2476"
            };

            // Act
            var serviceResult = await _tagAppService.CreateAsync(input);

            // Assert
            var result = await _tagRepository.FindAsync(c => c.Id == serviceResult.Id);

            result.ShouldNotBe(null);
            result.Name.ShouldBe("40cfea20f3034ca7890cb2476");
        }