Esempio n. 1
0
        public void SetUpService()
        {
            AutoMapperConfiguration.Configure();
            _mock                  = new Mock <IUnitOfWork>();
            _userServiceMock       = new Mock <IUserService>();
            _genreService          = new GenresService(_mock.Object);
            _gameService           = new GamesService(_mock.Object);
            _typeService           = new PlatformTypesService(_mock.Object);
            _roleService           = new RolesService(_mock.Object);
            _commentService        = new CommentsService(_mock.Object, _userServiceMock.Object);
            _orderService          = new OrdersService(_mock.Object);
            _translateService      = new TranslateService <Game, GameDTO>(_mock.Object);
            _translateGenreService = new TranslateService <Genre, GenreDTO>(_mock.Object);
            _service               = new Service <Game, GameDTO>(_mock.Object);

            _mock.Setup(a => a.Repository <Genre>().GetAll()).Returns(new List <Genre>());
            _mock.Setup(a => a.Repository <PlatformType>().GetAll()).Returns(new List <PlatformType>());
            _mock.Setup(a => a.Repository <Genre>().Edit(It.IsAny <Genre>()));
            _mock.Setup(a => a.Repository <GenreTranslate>().GetAll()).Returns(new List <GenreTranslate>());
            _mock.Setup(a => a.Repository <Comment>().Add(It.IsAny <Comment>()));

            _mock.Setup(a => a.Repository <Game>().Add(It.IsAny <Game>()));
            _mock.Setup(a => a.Repository <Game>().Edit(It.IsAny <Game>()));
            _mock.Setup(a => a.Repository <Game>().GetSingle(It.IsAny <string>())).Returns(new Game());
            _mock.Setup(a => a.Repository <Game>().Delete(It.IsAny <Game>()));
            _mock.Setup(a => a.Repository <Game>().FindBy(It.IsAny <Expression <Func <Game, bool> > >()))
            .Returns(new List <Game>());
        }
 public CurrencyController(
     INamedService <string, Currency, NamedFilters> service,
     IMapper mapper
     ) : base(
         service,
         mapper)
 {
 }
 public LegalEntityController(
     INamedService <Guid, LegalEntity, NamedFilters> service,
     IMapper mapper
     ) : base(
         service,
         mapper)
 {
 }
Esempio n. 4
0
 public RoleController(
     INamedService <Guid, Role, NamedFilters> service,
     IMapper mapper
     ) : base(
         service,
         mapper)
 {
 }
 public BranchController(
     INamedService <Guid, Branch, NamedFilters> service,
     IMapper mapper
     ) : base(
         service,
         mapper)
 {
 }
 protected NamedController(
     INamedService <TId, TNamed, TNamedFilters> service,
     IMapper mapper
     ) : base(
         service,
         mapper)
 {
     _service = service;
     _mapper  = mapper;
 }
Esempio n. 7
0
 public GamesController(IGameService gameService, INamedService <PlatformTypeDTO, PlatformTypeDTOTranslate> type,
                        INamedService <GenreDTO, GenreDTOTranslate> genre, IOrderService orders,
                        INamedService <PublisherDTO, PublisherDTOTranslate> publisher, IAuthenticationManager authentication)
     : base(authentication)
 {
     _genreService     = genre;
     _publisherService = publisher;
     _typeService      = type;
     _orderService     = orders;
     _gameService      = gameService;
 }
 public CountriesController(INamedService <Country> service)
 {
     _service = service;
 }
 public ShapesController(INamedService <Shape> service)
 {
     _service = service;
 }
Esempio n. 10
0
 public ServiceWithImportedCtorParameter([Import("blah")] INamedService namedDependency)
 {
     NamedDependency = namedDependency;
 }
Esempio n. 11
0
 public GenresController(INamedService <GenreDTO, GenreDTOTranslate> genre, IAuthenticationManager authentication) : base(authentication)
 {
     _genreService = genre;
 }
Esempio n. 12
0
 public PlatformTypesController(INamedService <PlatformTypeDTO, PlatformTypeDTOTranslate> publisher, IAuthenticationManager authentication) : base(authentication)
 {
     _typeService = publisher;
 }
Esempio n. 13
0
 public PublishersController(INamedService <PublisherDTO, PublisherDTOTranslate> publisher, IAuthenticationManager authentication) : base(authentication)
 {
     _publisherService = publisher;
 }
Esempio n. 14
0
 public UsersController(IGameService service, IUserService user, INamedService <RoleDTO, RoleDTOTranslate> roleService, IAuthenticationManager authentication) : base(authentication)
 {
     _service     = service;
     _userService = user;
     _roleService = roleService;
 }
Esempio n. 15
0
 public AlloysController(INamedService <Alloy> service)
 {
     _service = service;
 }
Esempio n. 16
0
 public CurrenciesController(INamedService <Currency> service)
 {
     _service = service;
 }
 public SubjectsController(INamedService <Subject> service)
 {
     _service = service;
 }
Esempio n. 18
0
 public RolesController(INamedService <RoleDTO, RoleDTOTranslate> role, IAuthenticationManager authentication) : base(authentication)
 {
     _roleService = role;
 }