/// <summary> /// Returns list of age certifications. /// Filtered by country if <see cref="GetAgeCertificationsRequest.Country"/> is set. /// </summary> /// <param name="request">Container for the necessary parmeters to execute the <see cref="GetAgeCertifications(GetAgeCertificationsRequest)"/> method.</param> /// <returns>The response from the Age Certifications API.</returns> public List <GetAgeCertificationResponse> GetAgeCertifications(GetAgeCertificationsRequest request) { var response = this.ApiRequest <List <GetAgeCertificationResponse> >(request); response = (request.Country == null) ? response : response.Where(x => x.Country == Utils.GetCountryCode((Country)request.Country)).ToList(); response = (request.ContentType == null) ? response : response.Where(x => x.ObjectType == Utils.GetContentTypeString((ContentType)request.ContentType)).ToList(); return(response); }
public async Task GetAgeCertificationsAsync_Movie_HasOnlyMovieResults() { var request = new GetAgeCertificationsRequest() { ContentType = ContentType.Movie }; var response = await client.GetAgeCertificationsAsync(request); Assert.IsNotNull(response); Assert.IsTrue(response.Count > 0); Assert.AreEqual(0, response.Where(x => x.ObjectType != "movie").Count()); }
public async Task GetAgeCertificationsAsync_UnitedStates_HasOnlyUSResults() { var request = new GetAgeCertificationsRequest() { Country = Country.UnitedStates }; var response = await client.GetAgeCertificationsAsync(request); Assert.IsNotNull(response); Assert.IsTrue(response.Count > 0); Assert.AreEqual(0, response.Where(x => x.Country != "US").Count()); }