/// <summary> /// Initializes a new instance of the <see cref="KindActionService" /> class. /// </summary> /// <param name="kindActionRepository">The KindAction repository.</param> /// <param name="userRepository">The user repository.</param> /// <param name="ratingService">The rating service.</param> public KindActionService( IKindActionRepository kindActionRepository, IUserRepository userRepository, RatingService ratingService) { _kindActionRepository = kindActionRepository; _userRepository = userRepository; _ratingService = ratingService; }
public void Init() { _repository = new KindActionRepository(); _userRepository = new UserRepository(); _ratingRepository = new RatingRepository(); _ratingService = new RatingService(_userRepository, _ratingRepository, true); _service = new KindActionService(_repository, _userRepository, _ratingService); _imageService = new ImageService(new ImageProvider(), new UserRepository()); _appCountersService = new AppCountersService(new AppCountersRepository()); var principal = new ClaimsPrincipal(); principal.AddIdentity(new ClaimsIdentity(new[] { new Claim(ClaimTypes.Sid, "User1Id") })); _controller = new KindActionController(_service, _imageService, _appCountersService) { User = principal }; }