Ejemplo n.º 1
0
        public UpdatePlaceValidator(IPlacesRepository placesRepository)
        {
            _placesRepository = placesRepository;

            RuleFor(p => p.Id).Must(id => CheckIfPlaceExists(id)).WithMessage("Place Not Found").NotEmpty().GreaterThan(0);
            RuleFor(p => p.Payload.Name).MaximumLength(50);
            RuleFor(p => p.Payload.Description).MaximumLength(150);
        }
Ejemplo n.º 2
0
            public Arrangement(ICSVStopRepository csvStopRepository, IPlacesRepository placesRepository, IMapper mapper)
            {
                Mapper            = mapper;
                PlacesRepository  = placesRepository;
                CSVStopRepository = csvStopRepository;

                SUT = new StopController(csvStopRepository, placesRepository, mapper);
            }
Ejemplo n.º 3
0
 public ToursController(IToursRepository toursRepository, IPlacesRepository placesRepository,
                        IAudioAssetsRepository audioAssetsRepository, IImageAssetsRepository imageAssetsRepository,
                        IBlobStorageService blobStorageService, TourDTOConverters tourDTOConverters)
 {
     _toursRepository       = toursRepository;
     _placesRepository      = placesRepository;
     _audioAssetsRepository = audioAssetsRepository;
     _imageAssetsRepository = imageAssetsRepository;
     _blobStorageService    = blobStorageService;
     _tourDTOConverters     = tourDTOConverters;
 }
Ejemplo n.º 4
0
        public async static Task <Place> AddPlaceToDatabase(IPlacesRepository placesRepository, PlaceEditModel place)
        {
            var placeFromDatabase = await placesRepository.FindAsync(place.Id.Value);

            if (placeFromDatabase == null)
            {
                return(await placesRepository.AddAsync(place));
            }

            return(placeFromDatabase);
        }
Ejemplo n.º 5
0
 public EventsDaemon(IEventsRepository eventsRepository,
                     IPlacesRepository placesRepository,
                     string targetUrl,
                     int timespan)
 {
     this.targetUrl        = targetUrl;
     this.timespan         = timespan;
     this.httpClient       = HttpClientFactory.Create();
     this.eventsRepository = eventsRepository;
     this.placesRepository = placesRepository;
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PlacesApiController"/> class.
        /// </summary>
        /// <param name="placesRepository">The places repository.</param>
        /// <param name="loggingService">The logging service.</param>
        /// <exception cref="System.ArgumentNullException">
        /// placesRepository
        /// or
        /// loggingService
        /// </exception>
        public PlacesApiController(IPlacesRepository placesRepository, ILoggingService loggingService)
        {
            if (placesRepository == null)
            {
                throw new ArgumentNullException(nameof(placesRepository));
            }
            if (loggingService == null)
            {
                throw new ArgumentNullException(nameof(loggingService));
            }

            this.placesRepository = placesRepository;
            this.loggingService   = loggingService;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AddressesRepository"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="placesRepository">The places repository.</param>
        /// <param name="loggingService">The logging service.</param>
        /// <exception cref="ArgumentNullException">
        /// context
        /// or
        /// placesRepository
        /// or
        /// loggingService
        /// </exception>
        public AddressesRepository(ApplicationDbContext context, IPlacesRepository placesRepository, ILoggingService loggingService)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (placesRepository == null)
            {
                throw new ArgumentNullException(nameof(placesRepository));
            }

            this.context          = context;
            this.placesRepository = placesRepository;
            this.logger           = loggingService?.GetLogger <AddressesRepository>();
        }
        public void DogsControllerTestsSetup()
        {
            _dogsRepository = MockRepository.GenerateMock<IRepository<Dog>>();
              _breedsRepository = MockRepository.GenerateMock<IRepository<Breed>>();
              _placesRepository = MockRepository.GenerateMock<IPlacesRepository>();
              _unitofWork = MockRepository.GenerateMock<IUnitOfWork>();
              _dogSearchhelper = MockRepository.GenerateMock<IDogSearchService>();
              _configuration = MockRepository.GenerateMock<IConfiguration>();

              _breedsRepository.Stub(x => x.GetById(Arg<int>.Is.Anything)).Return(
            new Breed {Name = "Beagel"});

              _configuration.Stub(x => x.GetNationwideSearchResultsDescriptionMessageForAllBreeds())
            .Return("Search results {0} to {1} out of {2} results for all breeds nationwide.");
              _configuration.Stub(x => x.GetNationwideSearchResultsDescriptionMessageForSpecificBreed())
            .Return("Showing results {0} to {1} out of {2} results for {3} nationwide");
              _configuration.Stub(x => x.GetLocalSearchResultsDescriptionMessageForAllBreeds())
            .Return("Search results {0} to {1} out of {2} results for all breeds in {3}");

              _dogsController = new DogsController(_dogsRepository, _breedsRepository, _unitofWork, _dogSearchhelper, _configuration, _placesRepository);

              StubDogsRepository();
        }
Ejemplo n.º 9
0
 public PlaceSearcher(IPlacesRepository placesRepository, RandomProvider randomProvider)
 {
     this.placesRepository = placesRepository;
     this.randomProvider   = randomProvider;
 }
Ejemplo n.º 10
0
 public MeetingsRepository(string connectionString, IUsersRepository usersRepository, IPlacesRepository placesRepository)
 {
     _connectionString = connectionString;
     UsersRepository = usersRepository;
     PlacesRepository = placesRepository;
 }
Ejemplo n.º 11
0
 public DogLocationFilter(IPlacesRepository placesRepository, IConfiguration configuration)
 {
     _placesRepository = placesRepository;
     _configuration = configuration;
 }
Ejemplo n.º 12
0
 public PlacesService(IPlacesRepository placeRepository, ILogger logger)
 {
     _placeRepository = placeRepository;
     _logger          = logger;
 }
 public CommandPlaceCreate(
     IQueryDispatcher queryDispatcher,
     IPlacesRepository placesRepository)
 {
     this.placesRepository = placesRepository ?? throw new ArgumentNullException(nameof(placesRepository));
 }
 public QueryPlacesFiltered(IPlacesRepository placesRepository)
 {
     this.placesRepository = placesRepository ?? throw new System.ArgumentNullException(nameof(placesRepository));
 }
Ejemplo n.º 15
0
 //private readonly IBookingsHistoryService bookingsHistoryService;
 //private readonly IBookingsService bookingsService;
 public PlacesService(IPlacesRepository placesRepository)
 {
     _placesRepository = placesRepository;
 }
        public PlaceIdRequestValidator(IPlacesRepository placesRepository)
        {
            _placesRepository = placesRepository;

            RuleFor(e => e.Id).Must(id => CheckIfPlaceExists(id)).WithMessage("Place Not Found").GreaterThan(0);
        }
Ejemplo n.º 17
0
 public DaemonController(IEventsRepository eventsRepository, IPlacesRepository placesRepository)
 {
     this.eventsRepository = eventsRepository;
     this.placesRepository = placesRepository;
 }
 public StopController(ICSVStopRepository stopRepository, IPlacesRepository placesRepository, IMapper mapper)
 {
     this.mapper           = mapper ?? throw new ArgumentNullException(nameof(mapper));
     this.stopRepository   = stopRepository ?? throw new ArgumentNullException(nameof(stopRepository));
     this.placesRepository = placesRepository ?? throw new ArgumentNullException(nameof(placesRepository));
 }
Ejemplo n.º 19
0
 public PlacesController(IPlacesRepository placesRepository)
 {
     this.placesRepository = placesRepository;
 }