public void Initialize()
        {
            var source = MockRepository.GenerateMock<HttpPostedFileBase>();

            source.Stub(x => x.ContentLength).Return(12345678);

            this.Source = source;

            var authentication = MockRepository.GenerateMock<IAuthenticationService>();

            authentication.Stub(x => x.Identity).Return(new FakeUserIdentity());

            var date = DateTime.Now;

            _path = "{0}\\{1}\\{2}".FormatInvariant(date.Year, date.Month, date.Day);

            var image = MockRepository.GenerateMock<IImageService>();

            image.Stub(x => x.Save(this.Source, _path)).Return(new ImageResult
            {
                FileName = "test.jpg",
                FileDiskName = "test2.jpg",
                FileType = "test3",
                FileExtension = "jpg",
                FilePath = _path
            });

            this.UserAvatarService = new UserAvatarService(
                MockRepository.GenerateMock<IFileService>(),
                image,
                authentication,
                MockRepository.GenerateMock<IRepository<UserAvatar>>()
            );
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetUserAvatarQueryHandler"/> class.
 /// </summary>
 /// <param name="systemFilesService"></param>
 /// <param name="userManager"></param>
 /// <param name="userAvatarService"></param>
 /// <param name="rootsService"></param>
 /// <param name="logger"></param>
 public GetUserAvatarQueryHandler(
     ISystemFilesService systemFilesService,
     IUserManager userManager,
     IUserAvatarService userAvatarService,
     IRootsService rootsService,
     IEmLogger logger)
 {
     this.systemFilesService = systemFilesService;
     this.userManager        = userManager;
     this.userAvatarService  = userAvatarService;
     this.rootsService       = rootsService;
     this.logger             = logger;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExternalAuthenticationCommandHandler"/> class.
 /// </summary>
 /// <param name="logger"></param>
 /// <param name="userManager"></param>
 /// <param name="userAvatarService"></param>
 /// <param name="externalProviderAuthenticatorFactory"></param>
 /// <param name="eventManager"></param>
 public ExternalAuthenticationCommandHandler(
     IEmLogger logger,
     IUserManager userManager,
     IUserAvatarService userAvatarService,
     IExternalProviderAuthenticatorFactory externalProviderAuthenticatorFactory,
     IIdentityEventManager eventManager)
 {
     this.logger            = logger;
     this.userManager       = userManager;
     this.userAvatarService = userAvatarService;
     this.externalProviderAuthenticatorFactory = externalProviderAuthenticatorFactory;
     this.eventManager = eventManager;
 }
        public UserAvatarLocalService(IUserService userService,
                                      ILocalStorageService localStorageService, IAuthService authService,
                                      IUserAvatarService userAvatarService1, IMediator mediator)
        {
            _userService = userService;
            //_userService.AuthenticatedUserChanged += _userAvatarService_OnChange;

            _localStorageService = localStorageService;

            _authService = authService;
            //_authService.LoggedIn += _authService_LoggedIn;
            //_authService.LoggedOut += _authService_LoggedOut;

            _userAvatarService = userAvatarService1;

            Mediator = mediator;
        }
Example #5
0
 public UserService(
     EruContext context,
     IUserAvatarService avatarService,
     IUserUrlService urlService,
     IUserProfileService profileService,
     AuthenticationService authenticationService,
     RoleService roleService,
     PermissionService permissionService
     )
 {
     _context               = context;
     _passwordHasher        = new PasswordHasher <string>();
     _avatarService         = avatarService;
     _urlService            = urlService;
     _profileService        = profileService;
     _authenticationService = authenticationService;
     _permissionService     = permissionService;
     _roleService           = roleService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ChangeUserAvatarCommandHandler"/> class.
 /// </summary>
 /// <param name="userAvatarService"></param>
 /// <param name="logger"></param>
 public ChangeUserAvatarCommandHandler(IUserAvatarService userAvatarService, IEmLogger logger)
 {
     this.userAvatarService = userAvatarService;
     this.logger            = logger;
 }
 public ActiveAvatarEffect(IUserAvatarService userAvatarService)
 {
     _userAvatarService = userAvatarService;
 }
Example #8
0
 public UserAvatarController(IUserService userService, IUserAvatarService service)
 {
     _userService = userService;
     _service     = service;
 }
Example #9
0
 public AvatarController(IUserService userService, IUserAvatarService userAvatarService)
 {
     this.UserService = userService;
     this.UserAvatarService = userAvatarService;
 }