Example #1
0
 public RestaurantController(IRestaurantData restaurantData, IGreeter greeter, IRestaurantService restaurantService, IHttpService httpService)
 {
     _restaurantData    = restaurantData;
     _greeter           = greeter;
     _restaurantService = restaurantService;
     _httpService       = httpService;
 }
Example #2
0
 public ReservationController(IRestaurantService restserv,IReservationService irs, IFriendService ifs,IUserService ius)
 {
     this.restaurantService = restserv;
     this.reservationService = irs;
     this.friendService = ifs;
     this.userService = ius;
 }
Example #3
0
        /// <summary>
        /// Gets the Resturant service.
        /// </summary>
        /// <returns>The service.</returns>
        private static IRestaurantService GetService()
        {
            IoCContainer       container = IoCContainer.Init();
            IRestaurantService service   = container.Resolve <IRestaurantService>();

            return(service);
        }
Example #4
0
 //
 // GET: /Login/
 public LoginController(IUserService userService, ICustomerService custService, IRestaurantService restService, ITransporterService transporterService)
 {
     this.userService        = userService;
     this.custService        = custService;
     this.restService        = restService;
     this.transporterService = transporterService;
 }
        public CategoriesControllerTests()
        {
            this.dbContext     = MockDbContext.GetContext();
            this.configuration = new ConfigurationBuilder()
                                 .AddJsonFile("settings.json")
                                 .Build();

            this.restaurantImagesRepository = new EfDeletableEntityRepository <RestaurantImage>(this.dbContext);
            this.categoryImageRepository    = new EfDeletableEntityRepository <CategoryImage>(this.dbContext);
            this.restaurantRepository       = new EfDeletableEntityRepository <Restaurant>(this.dbContext);
            this.categoryRepository         = new EfDeletableEntityRepository <Category>(this.dbContext);
            this.favouriteRepository        = new EfRepository <FavouriteRestaurant>(this.dbContext);
            this.voteRepository             = new EfRepository <Vote>(this.dbContext);
            this.commentRepository          = new EfDeletableEntityRepository <Comment>(this.dbContext);

            this.voteService             = new VoteService(this.voteRepository);
            this.commentService          = new CommentService(this.commentRepository, this.voteService);
            this.cloudinaryService       = new CloudinaryImageService(this.configuration);
            this.restaurantImagesService = new RestaurantImageService(this.restaurantImagesRepository, this.cloudinaryService);
            this.restaurantService       = new RestaurantService(this.restaurantRepository, this.restaurantImagesService, this.commentService);

            this.categoryImageService = new CategoryImageService(this.categoryImageRepository, this.cloudinaryService);
            this.categoryService      = new CategoryService(this.categoryRepository, this.categoryImageService, this.restaurantService);
            this.favouriteService     = new FavouriteService(this.favouriteRepository);

            var httpContext = new DefaultHttpContext();
            var tempData    = new TempDataDictionary(httpContext, Mock.Of <ITempDataProvider>());

            this.controller = new CategoriesController(this.categoryService, this.restaurantService, this.favouriteService)
            {
                TempData = tempData,
            };

            AutoMapperConfig.RegisterMappings(typeof(ErrorViewModel).Assembly);
        }
Example #6
0
        public void InitializeTests()
        {
            AppDataContext        _context    = new AppDataContext();
            IRestaurantRepository _repository = new RestaurantRepository(_context);

            _service = new RestaurantService(_repository);
        }
Example #7
0
 public RestaurantsController(IRestaurantService _restaurantService, IMapper _mapper, IMealService _mealService, IMealCategoryService _mealCategoryService)
 {
     restaurantService   = _restaurantService;
     mapper              = _mapper;
     mealService         = _mealService;
     mealCategoryService = _mealCategoryService;
 }
Example #8
0
 public SizeFacade(ISizeService sizeService, ISizeTranslationService sizeTranslationService, IRestaurantService restaurantService, IItemSizeService itemSizeService, IUnitOfWorkAsync unitOfWork) : base(unitOfWork)
 {
     _sizeTranslationService = sizeTranslationService;
     _sizeService            = sizeService;
     _restaurantService      = restaurantService;
     _itemSizeService        = itemSizeService;
 }
 public FacilitatorAppService(IFacilitatorService facilitatorService, IUserService userService
                              , IRestaurantService restaurantService)
 {
     this._facilitatorService = facilitatorService;
     this._userService        = userService;
     this._restaurantService  = restaurantService;
 }
Example #10
0
 public DishesController(IDishService dishService, IRestaurantService restaurantService, IIngredientService ingredientService, IRequestLogService requestLogService)
 {
     _dishService       = dishService;
     _restaurantService = restaurantService;
     _ingredientService = ingredientService;
     _requestLogService = requestLogService;
 }
 public Application(IRestaurantService restaurantService, IReviewService reviewService, ILoggingService loggingService, IInOut inOut)
 {
     this.restaurantService = restaurantService;
     this.reviewService     = reviewService;
     this.loggingService    = loggingService;
     this.inOut             = inOut;
 }
Example #12
0
 public SlackController(IRestaurantService restaurantService, ISlackService slackService, IStorageService storageService, ILogger <SlackController> log)
 {
     RestaurantService = restaurantService;
     SlackService      = slackService;
     StorageService    = storageService;
     Log = log;
 }
Example #13
0
 public ReviewController(IRestaurantService restaurantService, IReviewService reviewService, ILoggingService loggingService, IMapper mapper)
 {
     _restaurantService = restaurantService;
     _reviewService     = reviewService;
     _loggingService    = loggingService;
     _mapper            = mapper;
 }
Example #14
0
 public UserController(IUserService userService, IPasswordHelper pwHelp, ICommentService commentService, IRestaurantService restaurantService)
 {
     _userService       = userService;
     _pwencrypt         = pwHelp;
     _commentService    = commentService;
     _restaurantService = restaurantService;
 }
Example #15
0
 public SearchController(IRestaurantService restaurantService, IRestaurantRepository restaurantRepository,
                         IStatusRepository statusRepository)
 {
     _restaurantRepository = restaurantRepository;
     _statusRepository     = statusRepository;
     _restaurantService    = restaurantService;
 }
 public CommentsController(
     ICommentService commentService,
     IRestaurantService restaurantService)
 {
     this.commentService    = commentService;
     this.restaurantService = restaurantService;
 }
Example #17
0
 public RestaurantsController(
     IRestaurantService restaurantService,
     IMapper mapper)
 {
     _restaurantService = restaurantService;
     _mapper            = mapper;
 }
Example #18
0
 public PoolService(IPoolRepository poolRepository, IVoteRepository voteRepository, IRestaurantService restaurantAppService, IUserService userAppService)
 {
     this.poolRepository       = poolRepository;
     this.voteRepository       = voteRepository;
     this.restaurantAppService = restaurantAppService;
     this.userAppService       = userAppService;
 }
Example #19
0
 public ShoppingBasketService(IShoppingBasketRepository shoppingBasketRepository
                              , IUserService userService, IRestaurantService restaurantService)
 {
     _shoppingBasketRepository = shoppingBasketRepository;
     _userService       = userService;
     _restaurantService = restaurantService;
 }
Example #20
0
 public OrderModel(IHubContext <PushHub> hubContext, IRestaurantService restaurantService)
 {
     _hubContext        = hubContext;
     _restaurantService = restaurantService;
     _restaurantService.OrderPrepared += OrderPreparedEventHandler;
     _restaurantService.OrderPaid     += OrderPaidEventHandler;
 }
 public MealsController(IMealService _mealService, IMealCategoryService _mealCategoryService, IRestaurantService _restaurantService, IMealTypeService _mealTypeService)
 {
     mealService         = _mealService;
     restaurantService   = _restaurantService;
     mealCategoryService = _mealCategoryService;
     mealTypeService     = _mealTypeService;
 }
 public SideItemFacade(ISideItemService sideItem, ISideItemTranslationService sideItemTranslationService, IRestaurantService restaurantService, ItemSideItemService itemSideItemService, IUnitOfWorkAsync unitOfWork) : base(unitOfWork)
 {
     _sideItemTranslationService = sideItemTranslationService;
     _sideItemService            = sideItem;
     _restaurantService          = restaurantService;
     _itemSideItemService        = itemSideItemService;
 }
        public async Task GetRestaurantById_WithData_ShouldReturnCorrectResult()
        {
            var context = ReserveTableDbContextInMemoryFactory.InitializeContext();

            this.restaurantService = new RestaurantService(context);
            await SeedData(context);

            var restaurantId   = "1";
            var expectedResult = new RestaurantServiceModel
            {
                Id          = "1",
                Name        = "Ego",
                Address     = "Egos Address",
                CityId      = "1",
                PhoneNumber = "0888888888",
                Photo       = "/src/ego-photo.jpg"
            };

            var actualResult = await restaurantService.GetRestaurantById(restaurantId);

            Assert.Equal(expectedResult.Name, actualResult.Name);
            Assert.Equal(expectedResult.Address, actualResult.Address);
            Assert.Equal(expectedResult.CityId, actualResult.CityId);
            Assert.Equal(expectedResult.PhoneNumber, actualResult.PhoneNumber);
            Assert.Equal(expectedResult.Photo, actualResult.Photo);
        }
        public RestaurantImagesControllerTests()
        {
            this.dbContext     = MockDbContext.GetContext();
            this.configuration = new ConfigurationBuilder()
                                 .AddJsonFile("settings.json")
                                 .Build();

            this.restaurantImagesRepository = new EfDeletableEntityRepository <RestaurantImage>(this.dbContext);
            this.restaurantRepository       = new EfDeletableEntityRepository <Restaurant>(this.dbContext);
            this.userRepository             = new EfDeletableEntityRepository <ApplicationUser>(this.dbContext);
            this.voteRepository             = new EfRepository <Vote>(this.dbContext);
            this.commentRepository          = new EfDeletableEntityRepository <Comment>(this.dbContext);

            this.voteService             = new VoteService(this.voteRepository);
            this.commentService          = new CommentService(this.commentRepository, this.voteService);
            this.userImageService        = new UserImageService(this.userRepository, this.cloudinaryService);
            this.cloudinaryService       = new CloudinaryImageService(this.configuration);
            this.restaurantImagesService = new RestaurantImageService(this.restaurantImagesRepository, this.cloudinaryService);
            this.restaurantService       = new RestaurantService(this.restaurantRepository, this.restaurantImagesService, this.commentService);
            this.userService             = new UserService(this.restaurantService, this.userImageService, this.userRepository);

            var httpContext = new DefaultHttpContext();
            var tempData    = new TempDataDictionary(httpContext, Mock.Of <ITempDataProvider>());

            this.controller = new RestaurantImagesController(this.restaurantImagesService, this.userService, this.restaurantService)
            {
                TempData = tempData,
            };
        }
 public MealService(ApplicationDbContext applicationDbContext, IMapper mapper, IBlobStorageService blobStorageService, IRestaurantService restaurantService)
 {
     this.applicationDbContext = applicationDbContext;
     this.restaurantService    = restaurantService;
     this.mapper             = mapper;
     this.blobStorageService = blobStorageService;
 }
 public MemberController(IMemberService memberService, IConfiguration configuration, IMailService mailService, IRestaurantService restaurantService)
 {
     this.MemberService     = memberService;
     this.Configuration     = configuration;
     this.MailService       = mailService;
     this.RestaurantService = restaurantService;
 }
 public RestaurantApplicationService(IUnitOfWork uow,
                                     IRestaurantRepository restaurantRepository,
                                     IRestaurantService restaurantService
                                     ) : base(uow)
 {
     _restaurantRepository = restaurantRepository;
     _restaurantService    = restaurantService;
 }
 public RestaurantController(MLContext mlContext, PredictionEnginePool <RestaurantRating, RestaurantPrediction> machine_model, ILogger <RestaurantController> logger, IRestaurantService restaurantService, IUserProfileService userProfileService)
 {
     _mlContext          = mlContext;
     _machine_model      = machine_model;
     _logger             = logger;
     _restaurantService  = restaurantService;
     _userProfileService = userProfileService;
 }
Example #29
0
 public HomeController(IDishService productService, IRestaurantService shopService,
                       ICategoryService categoryService, IShoppingBasketService shoppingBasketService)
 {
     _dishService           = productService;
     _restaurantService     = shopService;
     _categoryService       = categoryService;
     _shoppingBasketService = shoppingBasketService;
 }
        public RestaurantsController(IRestaurantService eventService)
        {
/*            var db = new RestaurantSysContext();
            repo = new RestaurantRepository(db);*/

            restaurantService = eventService; //new RestaurantService(repo);

        }
 public RestaurantsController(IRestaurantService restaurantService,
                              ICuisineService cuisineService,
                              IMenuItemService menuItemService)
 {
     _restaurantService = restaurantService;
     _cuisineService    = cuisineService;
     _menuItemService   = menuItemService;
 }
Example #32
0
 public DishController(IDishService dishService,
                       ICategoryService categoryService,
                       IRestaurantService restaurantService)
 {
     _dishService       = dishService;
     _categoryService   = categoryService;
     _restaurantService = restaurantService;
 }
Example #33
0
 public RestaurantController(IRestaurantService restaurantService, ITypeOfRestauranService type, IRestaurantTableService table, IFoodService food, IRoleService roles, IUserService userserv, IFriendService ifr)
 {
     this.typeOfRestaurantService = type;
     this.restaurantService = restaurantService;
     this.restaurantTableService = table;
     this.foodService = food;
     this.roleService = roles;
     this.userService = userserv;
     this.friendService = ifr;
 }
        public void Initialize()
        {
            listRestaurant = new List<Restaurant>() {
              new Restaurant() { Id = 1, Name = "Apple Bees", CityID = 1 },
              new Restaurant() { Id = 2, Name = "TGI Fridays", CityID = 1 },
              new Restaurant() { Id = 3, Name = "Olive Garden", CityID = 2 }
             }.AsQueryable();

            _mockSet = new Mock<DbSet<Restaurant>>();
            _mockSet.As<IQueryable<Restaurant>>().Setup(m => m.Provider).Returns(listRestaurant.Provider);
            _mockSet.As<IQueryable<Restaurant>>().Setup(m => m.Expression).Returns(listRestaurant.Expression);
            _mockSet.As<IQueryable<Restaurant>>().Setup(m => m.ElementType).Returns(listRestaurant.ElementType);
            _mockSet.As<IQueryable<Restaurant>>().Setup(m => m.GetEnumerator()).Returns(listRestaurant.GetEnumerator());

            _mockContext = new Mock<IRRContext>();
            _mockContext.Setup(c => c.Set<Restaurant>()).Returns(_mockSet.Object);
            _mockContext.Setup(c => c.Restaurants).Returns(_mockSet.Object);

            _service = new RestaurantService(_mockContext.Object);
        }
Example #35
0
 public DishController(IDishService dishService, IRestaurantService restaurantService)
 {
     this.dishService = dishService;
     this.restaurantService = restaurantService;
 }
 public RestaurantsController(IRestaurantService service)
 {
     Service = service;            
 }
        public RestaurantCollectionViewModel(IRestaurantService restaurantService)
		{
            this.restaurantService = restaurantService;

            this.Resturants = new List<Restaurant>();
		}
 public RestaurantServiceBase(IRestaurantService serivce)
 {
     this.service = serivce;
 }
Example #39
0
 public HomeController(IRestaurantService restaurantService)
 {
     _restaurantService = restaurantService;
 }
Example #40
0
 public RestaurantController(IRestaurantService restaurantService)
 {
     this.restaurantService = restaurantService;
 }