Пример #1
0
 public AuthenticationController(IUserService userService, IMapper mapper
                                 , IOptions <AppSettings> appSettings, IJwtTokenUtils jwtTokenUtils)
 {
     _userService   = userService;
     _mapper        = mapper;
     _jwtTokenUtils = jwtTokenUtils;
     _secret        = appSettings.Value.Secret;
 }
Пример #2
0
 public UserService(IUserRepository userRepository, IProfileImageRepository imageRepository, IRandomCodeUtils randomCodeUtils, IHashUtils hashUtils, IEmailUtils emailUtils, IJwtTokenUtils jwtTokenUtils, IFileUploadUtils fileUploadUtils)
 {
     _userRepository  = userRepository;
     _imageRepository = imageRepository;
     _randomCodeUtils = randomCodeUtils;
     _hashUtils       = hashUtils;
     _emailUtils      = emailUtils;
     _jwtTokenUtils   = jwtTokenUtils;
     _fileUploadUtils = fileUploadUtils;
 }
Пример #3
0
        public UserServiceTest()
        {
            _userRepositoryMock  = NSubstitute.Substitute.For <IUserRepository>();
            _imageRepositoryMock = NSubstitute.Substitute.For <IProfileImageRepository>();
            _randomCodeUtils     = NSubstitute.Substitute.For <IRandomCodeUtils>();
            _hashUtilsMock       = NSubstitute.Substitute.For <IHashUtils>();
            _emailUtilsMock      = NSubstitute.Substitute.For <IEmailUtils>();
            _jwtTokenUtilsMock   = NSubstitute.Substitute.For <IJwtTokenUtils>();
            _fileUploadUtilsMock = NSubstitute.Substitute.For <IFileUploadUtils>();
            _userService         = new UserService(_userRepositoryMock, _imageRepositoryMock, _randomCodeUtils, _hashUtilsMock, _emailUtilsMock, _jwtTokenUtilsMock, _fileUploadUtilsMock);

            _fakeNotConfirmedInsertedUser = new User("Fake User", "*****@*****.**", "fake password");
            _fakeConfirmedInsertedUser    = new User("Fake User", "*****@*****.**", "fake password");
            _fakeConfirmedInsertedUser.Confirm();
            _fakeConfirmedInsertedUser.AddProfileImage(new ProfileImage("FILENAME", "FILEPATH"));
        }
Пример #4
0
 public JwtTokenUtilsTest()
 {
     _jwtTokenUtils = new JwtTokenUtils("secret_key_secret_key_secret_key");
 }