/// <summary> /// Initializes instance according to parameter values. /// </summary> /// <param name="apiKey">Key to get access to OMDb service.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="apiKey" /> is <c>null</c>. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="apiKey" /> presents empty strings or contains only whitespaces. /// </exception> public OmdbCrawlerAsync(string apiKey) { apiKey.ThrowIfNullOrWhiteSpace(nameof(apiKey)); _omdbClient = OmdbClientFactory.CreateClient(apiKey); _searchResults = new HashSet <BasicInfo>(); }
public void Setup() { _httpClient = new HttpClient(); _httpClient.BaseAddress = new Uri("http://www.omdbapi.com"); _httpClient.DefaultRequestHeaders.Accept.Clear(); _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); _omdbClient = new OmdbClient(_httpClient, new OmdbKey("b473dec9")); }
public MoviesService(IMoviesRepository moviesRepository, IOmdbClient omdbClient, ITmdbClient tmdbClient, IMoviesMapper moviesMapper, IMoviesRequestsCache requestsCache) { if (moviesRepository == null) { throw new ArgumentNullException(nameof(moviesRepository)); } if (omdbClient == null) { throw new ArgumentNullException(nameof(omdbClient)); } if (tmdbClient == null) { throw new ArgumentNullException(nameof(tmdbClient)); } if (moviesMapper == null) { throw new ArgumentNullException(nameof(moviesMapper)); } if (requestsCache == null) { throw new ArgumentNullException(nameof(requestsCache)); } _moviesRepository = moviesRepository; _omdbClient = omdbClient; _tmdbClient = tmdbClient; _moviesMapper = moviesMapper; _requestsCache = requestsCache; }
public LibraryService(MediaCollectionContext mediaCollectionContext, IParserService parserService, IOmdbClient omdbClient) { _mediaCollectionContext = mediaCollectionContext; _parserService = parserService; _omdbClient = omdbClient; }
public MovieController(IOmdbClient omdbClient) { _omdbClient = omdbClient; }
public WishlistController(IWishlistService service, IOmdbClient omdbClient) { _service = service; _omdbClient = omdbClient; }
/// <summary> /// Initializes instance according to parameter values. /// </summary> /// <param name="apiKey">Key to get access to OMDb service.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="apiKey" /> is <c>null</c>. /// </exception> /// <exception cref="ArgumentException"> /// <paramref name="apiKey" /> presents empty strings or contains only whitespaces. /// </exception> public OmdbCrawler(string apiKey) { apiKey.ThrowIfNullOrWhiteSpace(nameof(apiKey)); _omdbClient = OmdbClientFactory.CreateClient(apiKey); }
public MoviesController(IOmdbClient movieService, ILogger <MoviesController> logger) { this.movieService = movieService; this.logger = logger; }
public WishlistService(MediaCollectionContext mediaCollectionContext, IOmdbClient omdbClient) { _mediaCollectionContext = mediaCollectionContext; _omdbClient = omdbClient; }