public HotelReviewsServiceTests()
        {
            var services = new ServiceCollection();

            services.AddDbContext <MbDbContext>(opt =>
                                                opt.UseInMemoryDatabase(Guid.NewGuid().ToString()));
            services.AddScoped <IHotelReviewsService, HotelReviewsService>();
            services.AddScoped <IHotelsService, HotelsService>();
            services.AddScoped <IUsersService, UsersService>();
            services.AddScoped <IOblastsService, OblastsService>();

            Mapper.Reset();
            Mapper.Initialize(config => config.AddProfile(typeof(HotelsProfile)));
            services.AddScoped <IMapper>(service => Mapper.Instance);

            var account = new Account(GlobalConstants.CloudinaryName,
                                      GlobalConstants.CloudinaryKey, GlobalConstants.CloudinarySecret);

            services.AddScoped(x => new Cloudinary(account));
            services.AddScoped <ImagesUploader>();

            this.provider            = services.BuildServiceProvider();
            this.dbContext           = this.provider.GetService <MbDbContext>();
            this.hotelReviewsService = this.provider.GetService <IHotelReviewsService>();
        }
 public HotelsController(
     IHotelsService hotelsService,
     IHotelReviewsService hotelReviewsService,
     IHotelCommentsService hotelCommentsService,
     IOblastsService oblastsService,
     IMapper mapper)
 {
     this.hotelsService        = hotelsService;
     this.hotelReviewsService  = hotelReviewsService;
     this.hotelCommentsService = hotelCommentsService;
     this.oblastsService       = oblastsService;
     this.mapper = mapper;
 }
 public HotelReviewsController(IHotelReviewsService hotelReviewsService, IHotelsService hotelsService)
 {
     this.hotelReviewsService = hotelReviewsService;
     this.hotelsService       = hotelsService;
 }