public async Task AddUserAsync_ValidCreateUserModels_ReturnsReadFullUserInfo(CreateUserModel model)
        {
            //Arrange
            var cancellationToken = new CancellationToken();
            var expectedValue     = UserDumbData.GetReadFullUserModel(model);

            _userRepository.Setup(x => x.AddAsync(It.IsAny <User>(), cancellationToken)).Returns(Task.CompletedTask);
            _unitOfWork.Setup(x => x.SaveChangesAsync(cancellationToken)).Returns(Task.CompletedTask);
            _emailService.Setup(x => x.SendEmailAsync(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), cancellationToken)).Returns(Task.CompletedTask);

            string key             = "RegisterPage";
            var    localizedString = new LocalizedString(key, key);

            _stringLocalizer.Setup(_ => _[key]).Returns(localizedString);
            _hasher.Setup(x => x.GetHash(It.IsAny <string>())).Returns(model.Password);
            _fileService.Setup(x => x.AddOrUpdateFileByIdAsync(It.IsAny <IFormFile>(), It.IsAny <Guid?>(), cancellationToken)).Returns(Task.FromResult(expectedValue.AvatarId));
            _roleRepository.Setup(x => x.GetRoleByNameAsync(It.IsAny <string>(), cancellationToken)).Returns((string x) => Task.FromResult(RoleDumbData.GetEntity(x)));

            // Act
            var response = await _userService.AddUserAsync(model, cancellationToken);

            expectedValue.Id = response.Id;

            // Assert
            _userRepository.Verify(x => x.AddAsync(It.IsAny <User>(), cancellationToken), Times.Once);
            _unitOfWork.Verify(x => x.SaveChangesAsync(cancellationToken), Times.Once);
            _emailService.Verify(x => x.SendEmailAsync(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), cancellationToken), Times.Once);
            _stringLocalizer.Verify(_ => _[key], Times.Once);
            _hasher.Verify(x => x.GetHash(It.IsAny <string>()), Times.Once);
            _fileService.Verify(x => x.AddOrUpdateFileByIdAsync(It.IsAny <IFormFile>(), It.IsAny <Guid?>(), cancellationToken), Times.Once);
            _roleRepository.Verify(x => x.GetRoleByNameAsync(It.IsAny <string>(), cancellationToken), Times.Once);
            Assert.IsNotNull(response);
            expectedValue.Should().BeEquivalentTo(response);
        }
        public async Task UpdateUserAsync_ValidUpdateFullUserModelsWithIds_ReturnsReadFullUserModel(UpdateUserModel model)
        {
            //Arrange
            var expectedUser      = UserDumbData.GetEntity(model);
            var expectedValue     = _mapper.Map <ReadFullUserModel>(expectedUser);
            var cancellationToken = new CancellationToken();

            _userRepository.Setup(x => x.GetByIdAsync(It.IsAny <Guid>(), cancellationToken)).Returns(Task.FromResult(expectedUser));
            _userRepository.Setup(x => x.Update(It.IsAny <User>()));
            _fileService.Setup(x => x.AddOrUpdateFileByIdAsync(It.IsAny <IFormFile>(), It.IsAny <Guid?>(), cancellationToken)).Returns(Task.FromResult(expectedValue.AvatarId));
            _roleRepository.Setup(x => x.GetRoleByNameAsync(It.IsAny <string>(), cancellationToken)).Returns((string x) => Task.FromResult(RoleDumbData.GetEntity(x))).Verifiable();
            _unitOfWork.Setup(x => x.SaveChangesAsync(cancellationToken)).Returns(Task.CompletedTask);

            // Act
            var response = await _userService.UpdateUserAsync(model, expectedUser.Id, cancellationToken);

            // Assert
            _userRepository.Verify(x => x.GetByIdAsync(It.IsAny <Guid>(), cancellationToken), Times.Once);
            _userRepository.Verify(x => x.Update(It.IsAny <User>()), Times.Once);
            _fileService.Verify(x => x.AddOrUpdateFileByIdAsync(It.IsAny <IFormFile>(), It.IsAny <Guid?>(), cancellationToken), Times.Once);
            _unitOfWork.Verify(x => x.SaveChangesAsync(cancellationToken), Times.Once);
            _roleRepository.Verify(x => x.GetRoleByNameAsync(It.IsAny <string>(), cancellationToken), Times.Once);
            response.Should().BeEquivalentTo(expectedValue);
        }