public AuthenticationController(IUserService userService, IMapper mapper , IOptions <AppSettings> appSettings, IJwtTokenUtils jwtTokenUtils) { _userService = userService; _mapper = mapper; _jwtTokenUtils = jwtTokenUtils; _secret = appSettings.Value.Secret; }
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; }
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")); }
public JwtTokenUtilsTest() { _jwtTokenUtils = new JwtTokenUtils("secret_key_secret_key_secret_key"); }