public GetToursQueryHandler(
     IUnitOfWork unitOfWork,
     IMapper mapper,
     IPipelineBuilder <Expression <Func <Tour, bool> > > pipelineBuilder,
     ISortOptionFactory sortOptionFactory)
 {
     _mapper            = mapper;
     _pipelineBuilder   = pipelineBuilder;
     _sortOptionFactory = sortOptionFactory;
     _toursRepository   = unitOfWork.GetReadonlyRepository <Tour>();
 }
Exemple #2
0
 public GameService(
     IUnitOfWork unitOfWork,
     IGameDecorator gameDecorator,
     ISortOptionFactory <GameRoot> sortOptionFactory,
     IMapper mapper,
     IPublisherService publisherService)
 {
     _unitOfWork        = unitOfWork;
     _mapper            = mapper;
     _publisherService  = publisherService;
     _gameDecorator     = gameDecorator;
     _sortOptionFactory = sortOptionFactory;
 }
Exemple #3
0
        public void Setup()
        {
            _unitOfWork        = A.Fake <IUnitOfWork>();
            _gameDecorator     = A.Fake <IGameDecorator>();
            _mapper            = A.Fake <IMapper>();
            _visitRepository   = A.Fake <IAsyncRepository <Visit> >();
            _sortOptionFactory = A.Fake <ISortOptionFactory <GameRoot> >();
            _sortOption        = A.Fake <ISortOption <GameRoot> >();
            _publisherService  = A.Fake <IPublisherService>();

            A.CallTo(() => _sortOption.SortDirection).Returns(SortDirection.Descending);
            A.CallTo(() => _sortOption.SortPropertyAccessor).Returns(root => root.Details.Price);
            A.CallTo(() => _sortOptionFactory.Create(A <string> ._)).Returns(_sortOption);
            A.CallTo(() => _unitOfWork.GetRepository <IAsyncRepository <Visit> >()).Returns(_visitRepository);

            _gameServices =
                new GameService(_unitOfWork, _gameDecorator, _sortOptionFactory, _mapper, _publisherService);
        }