예제 #1
0
        public void TextSearchResultsWithOptions_ValidQueryWithOpenNow()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > textResults =
                placesSearch.GetTextSearchResultsWithOptions(PIZZA_QUERY, open_now: true);

            textResults.Wait();

            Places.NearbySearchResultList resultsList = textResults.Result.Item1;
            ResponseStatus response = textResults.Result.Item2;

            Assert.IsNotNull(resultsList);
            Assert.GreaterOrEqual(resultsList.Results.Count, 1);

            Assert.AreSame(response, Places.PlacesStatus.OK);

            for (int i = 0; i < resultsList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultsList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                Assert.IsNotNull(result.OpeningHours);
            }
        }
예제 #2
0
        public void NearbySearchResultsRBDWthOptions_ValidQueryWithOpenNow()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults =
                placesSearch.GetNearbySearchResultsRankByDistanceWithOptions(VALID_LOCATION,
                                                                             keyword: PIZZA_KEYWORD, open_now: true);

            searchResults.Wait();

            Places.NearbySearchResultList resultList = searchResults.Result.Item1;
            ResponseStatus responseStatus            = searchResults.Result.Item2;

            Assert.AreSame(responseStatus, Places.PlacesStatus.OK);

            Assert.IsNotNull(resultList);
            Assert.GreaterOrEqual(resultList.Results.Count, 1);

            for (int i = 0; i < resultList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                // Verifying OpeningHours
                Assert.IsNotNull(result.OpeningHours);
                Assert.IsTrue(result.OpeningHours.OpenNow);
            }
        }
예제 #3
0
        public void TextSearchResultsWithOptions_ValidQueryWithLocationAndRadius()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > textResults =
                placesSearch.GetTextSearchResultsWithOptions(PIZZA_QUERY, location: LOCATION_PURDUE, radius: RADIUS);

            textResults.Wait();

            Places.NearbySearchResultList resultsList = textResults.Result.Item1;
            ResponseStatus response = textResults.Result.Item2;

            Assert.IsNotNull(resultsList);
            Assert.GreaterOrEqual(resultsList.Results.Count, 1);

            Assert.AreSame(response, Places.PlacesStatus.OK);

            for (int i = 0; i < resultsList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultsList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                double dist = BasicFunctions.distanceBetweenLocations(result.Geometry.Location, LOCATION_PURDUE) / 1000.00;
                Assert.LessOrEqual(dist, RADIUS);
            }
        }
        public void FindPlacesWCLB_ValidQueryWithPriceLevel()
        {
            FIELDS_LIST.Add(Places.Fields.PRICE_LEVEL);

            Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates =
                placesSearch.FindPlacesWithCircularLocationBias(VALID_PHONE_NO,
                                                                Places.InputType.PHONENUMBER, VALID_LOCATION, VALID_RADIUS, FIELDS_LIST);

            candidates.Wait();

            Places.FindPlacesCandidateList candidateList = candidates.Result.Item1;
            Places.FindPlaceCandidates     candidate;
            ResponseStatus status = candidates.Result.Item2;

            // Verify that the Candidate list is of expected size
            Assert.IsNotNull(candidateList);
            Assert.GreaterOrEqual(candidateList.Candidates.Count, 1);

            // Verify that the place candidate result is as expected
            for (int i = 0; i < candidateList.Candidates.Count; i++)
            {
                candidate = candidateList.Candidates[i];

                Assert.IsNull(candidate.Place_id);
                Assert.IsNull(candidate.Name);

                Assert.GreaterOrEqual(candidate.PriceLevel, 0);
            }

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            FIELDS_LIST.Clear();
        }
예제 #5
0
        public void NearbySearchResultsRBDWthOptions_ValidQueryWithMinMaxPrice()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults =
                placesSearch.GetNearbySearchResultsRankByDistanceWithOptions(VALID_LOCATION,
                                                                             keyword: PIZZA_KEYWORD, min_price: 1, max_price: 2);

            searchResults.Wait();

            Places.NearbySearchResultList resultList = searchResults.Result.Item1;
            ResponseStatus responseStatus            = searchResults.Result.Item2;

            Assert.AreSame(responseStatus, Places.PlacesStatus.OK);

            Assert.IsNotNull(resultList);
            Assert.GreaterOrEqual(resultList.Results.Count, 1);

            for (int i = 0; i < resultList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                Assert.GreaterOrEqual(result.PriceLevel, 1);
                Assert.LessOrEqual(result.PriceLevel, 2);
            }
        }
        public void FindPlacesWPLB_ValidQueryWithIcon()
        {
            FIELDS_LIST.Add(Places.Fields.ICON);

            Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates =
                placesSearch.FindPlaceWithPointLocationBias(PIZZA_QUERY, VALID_LOCATION, FIELDS_LIST);

            candidates.Wait();

            Places.FindPlacesCandidateList candidateList = candidates.Result.Item1;
            Places.FindPlaceCandidates     candidate     = candidateList.Candidates[0];
            ResponseStatus status = candidates.Result.Item2;

            // Verify that the Candidate list is of expected size
            Assert.IsNotNull(candidateList);
            Assert.AreEqual(candidateList.Candidates.Count, 1);

            // Verify that the place candidate result is as expected
            Assert.IsNull(candidate.Place_id);
            Assert.IsNull(candidate.Name);

            Assert.IsNotNull(candidate.Icon);
            Assert.IsNotEmpty(candidate.Icon);

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            FIELDS_LIST.Clear();
        }
예제 #7
0
        public void FindPlacesWRLB_ValidQueryWithRating()
        {
            FIELDS_LIST.Add(Places.Fields.RATING);

            Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates =
                placesSearch.FindPlacesWithRectLocationBias(PIZZA_QUERY, Places.InputType.TEXTQUERY, SW_LOCATION, NE_LOCATION, FIELDS_LIST);

            candidates.Wait();

            Places.FindPlacesCandidateList candidateList = candidates.Result.Item1;
            Places.FindPlaceCandidates     candidate;
            ResponseStatus status = candidates.Result.Item2;

            // Verify that the Candidate list is of expected size
            Assert.IsNotNull(candidateList);
            Assert.GreaterOrEqual(candidateList.Candidates.Count, 1);

            // Verify that the place candidate result is as expected
            for (int i = 0; i < candidateList.Candidates.Count; i++)
            {
                candidate = candidateList.Candidates[i];

                Assert.IsNull(candidate.Place_id);
                Assert.IsNull(candidate.Name);

                Assert.GreaterOrEqual(candidate.Rating, 0);
            }

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            FIELDS_LIST.Clear();
        }
예제 #8
0
        public void TextSearchResultsWithOptions_ValidQueryWithTypes()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > textResults =
                placesSearch.GetTextSearchResultsWithOptions(PIZZA_QUERY, type: Places.NearbySearchTypes.MEAL_TAKEAWAY);

            textResults.Wait();

            Places.NearbySearchResultList resultsList = textResults.Result.Item1;
            ResponseStatus response = textResults.Result.Item2;

            Assert.IsNotNull(resultsList);
            Assert.GreaterOrEqual(resultsList.Results.Count, 1);

            Assert.AreSame(response, Places.PlacesStatus.OK);

            for (int i = 0; i < resultsList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultsList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                // Verifying Types
                Assert.IsNotNull(result.Types);
                Assert.GreaterOrEqual(result.Types.Count, 1);
                Assert.IsTrue(result.Types.Contains(Places.NearbySearchTypes.MEAL_TAKEAWAY.ToString().ToLower()));
            }
        }
예제 #9
0
        public void TextSearchResultsWithOptions_ValidQueryWithMinMaxPrice()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > textResults =
                placesSearch.GetTextSearchResultsWithOptions(PIZZA_QUERY, min_price: 1, max_price: 2);

            textResults.Wait();

            Places.NearbySearchResultList resultsList = textResults.Result.Item1;
            ResponseStatus response = textResults.Result.Item2;

            Assert.IsNotNull(resultsList);
            Assert.GreaterOrEqual(resultsList.Results.Count, 1);

            Assert.AreSame(response, Places.PlacesStatus.OK);

            for (int i = 0; i < resultsList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultsList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                Assert.GreaterOrEqual(result.PriceLevel, 1);
                Assert.LessOrEqual(result.PriceLevel, 2);
            }
        }
예제 #10
0
        public void PlacesDetailWithOptions_ValidRequest()
        {
            Task <Tuple <Places.PlacesDetailResponse, ResponseStatus> > details =
                placesDetail.GetPlaceDetailsWithOptions(PLACE_ID_WL);

            details.Wait();

            Places.PlacesDetailResponse response     = details.Result.Item1;
            Places.PlacesDetailResult   detailResult = response.Result;
            ResponseStatus status = details.Result.Item2;

            // Verify that the result list is of expected size
            Assert.IsNotNull(response);
            Assert.IsNotNull(detailResult);

            // Verify that the place result result is as expected
            Assert.IsNotNull(detailResult.AddressComponents);
            Assert.GreaterOrEqual(detailResult.AddressComponents.Count, 1);

            Assert.IsNotNull(detailResult.AdrAddress);
            Assert.IsNotEmpty(detailResult.AdrAddress);

            Assert.IsNotNull(detailResult.FormattedAddress);
            Assert.IsNotEmpty(detailResult.FormattedAddress);

            Assert.IsNotNull(detailResult.Geometry);

            Assert.IsNotNull(detailResult.Icon);
            Assert.IsNotEmpty(detailResult.Icon);

            Assert.IsNotNull(detailResult.Name);
            Assert.IsNotEmpty(detailResult.Name);

            Assert.IsNotNull(detailResult.PlaceId);
            Assert.IsNotEmpty(detailResult.PlaceId);

            Assert.IsNotNull(detailResult.PlusCode);

            Assert.IsNotNull(detailResult.Reference);
            Assert.IsNotEmpty(detailResult.Reference);

            Assert.IsNotNull(detailResult.Types);
            Assert.GreaterOrEqual(detailResult.Types.Count, 1);

            Assert.IsNotNull(detailResult.Url);
            Assert.IsNotEmpty(detailResult.Url);

            Assert.IsNotNull(detailResult.Vicinity);
            Assert.IsNotEmpty(detailResult.Vicinity);

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);
        }
        public void NearbySearchResultsRBPWithOptions_ValidQueryWithAllOptions()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults =
                placesSearch.GetNearbySearchResultsRankByProminenceWithOptions(VALID_LOCATION,
                                                                               LARGE_RADIUS, open_now: true, keyword: "mexican", min_price: 1, max_price: 3, type: Places.NearbySearchTypes.RESTAURANT);

            searchResults.Wait();

            Places.NearbySearchResultList resultList = searchResults.Result.Item1;
            ResponseStatus responseStatus            = searchResults.Result.Item2;

            Assert.AreSame(responseStatus, Places.PlacesStatus.OK);

            Assert.IsNotNull(resultList);
            Assert.GreaterOrEqual(resultList.Results.Count, 1);

            Boolean hasKeyword = false;

            for (int i = 0; i < resultList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                if (result.Name.ToLower().Contains("mexican"))
                {
                    hasKeyword = true;
                }

                // Verifying OpeningHours
                Assert.IsNotNull(result.OpeningHours);
                Assert.IsTrue(result.OpeningHours.OpenNow);

                // Verifying PriceLevel for each item
                Assert.GreaterOrEqual(result.PriceLevel, 1);
                Assert.LessOrEqual(result.PriceLevel, 3);

                // Verifying Types
                Assert.IsNotNull(result.Types);
                Assert.GreaterOrEqual(result.Types.Count, 1);
                Assert.IsTrue(result.Types.Contains("restaurant") || result.Types.Contains("food"));
            }

            Assert.IsTrue(hasKeyword);
        }
예제 #12
0
        public void VideoAnnotationMultipleDetections_ValidQueryWithAllDetections()
        {
            Task <Tuple <VideoAnnotationResponse, ResponseStatus> > response =
                videoIntelligence.AnnotateVideoWithMultipleDetections(inputUri: VALID_VIDEO_URL,
                                                                      explicitContentDetection: true, labelDetection: true, shotChangeDetection: true);

            response.Wait();

            VideoAnnotationResponse annotationResponse = response.Result.Item1;
            ResponseStatus          status             = response.Result.Item2;

            Assert.AreSame(status, VideoAnnotationStatus.OK);

            Assert.IsNotNull(annotationResponse);
            Assert.IsTrue(annotationResponse.Done);

            Assert.IsNotNull(annotationResponse.Metadata);
            Assert.AreEqual(annotationResponse.Metadata.Type, "type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoProgress");
            Assert.GreaterOrEqual(annotationResponse.Metadata.annotationProgress.Count, 1);

            Boolean foundCompletedProgress = false;

            for (int i = 0; i < annotationResponse.Metadata.annotationProgress.Count; i++)
            {
                AnnotationProgress annotationProgress = annotationResponse.Metadata.annotationProgress[i];

                if (annotationProgress.ProgressPercent == 100)
                {
                    foundCompletedProgress = true;
                    break;
                }
            }
            Assert.IsTrue(foundCompletedProgress);

            Assert.IsNotNull(annotationResponse.Name);

            Assert.IsNotNull(annotationResponse.Response);
            Assert.AreEqual(annotationResponse.Response.Type, "type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoResponse");

            Assert.AreEqual(annotationResponse.Response.AnnotationResults.Count, 1);
            Assert.IsTrue(VALID_VIDEO_URL.Contains(annotationResponse.Response.AnnotationResults[0].InputUri));

            Assert.GreaterOrEqual(annotationResponse.Response.AnnotationResults[0].SegmentLabelAnnotations.Count, 1);
            Assert.GreaterOrEqual(annotationResponse.Response.AnnotationResults[0].ShotLabelAnnotations.Count, 1);

            Assert.IsNotNull(annotationResponse.Response.AnnotationResults[0].ExplicitAnnotation);
            Assert.GreaterOrEqual(annotationResponse.Response.AnnotationResults[0].ExplicitAnnotation.Frames.Count, 1);

            Assert.GreaterOrEqual(annotationResponse.Response.AnnotationResults[0].ShotAnnotations.Count, 1);
        }
예제 #13
0
        public void PlacesDetailWithOptions_ValidRequestWithReviews()
        {
            FIELDS_LIST.Add(Places.PlacesDetailFields.REVIEW);

            Task <Tuple <Places.PlacesDetailResponse, ResponseStatus> > details =
                placesDetail.GetPlaceDetailsWithOptions(PLACE_ID_NYC, fields: FIELDS_LIST);

            details.Wait();

            Places.PlacesDetailResponse response     = details.Result.Item1;
            Places.PlacesDetailResult   detailResult = response.Result;
            ResponseStatus status = details.Result.Item2;

            // Verify that the result list is of expected size
            Assert.IsNotNull(response);
            Assert.IsNotNull(detailResult);

            Assert.IsNotNull(detailResult.Reviews);
            Assert.GreaterOrEqual(detailResult.Reviews.Count, 1);

            Assert.IsNotNull(detailResult.Reviews[0].AuthorName);
            Assert.IsNotEmpty(detailResult.Reviews[0].AuthorName);

            Assert.IsNotNull(detailResult.Reviews[0].AuthorUrl);
            Assert.IsNotEmpty(detailResult.Reviews[0].AuthorUrl);

            Assert.IsNotNull(detailResult.Reviews[0].Language);
            Assert.IsNotEmpty(detailResult.Reviews[0].Language);

            Assert.IsNotNull(detailResult.Reviews[0].ProfilePhotoUrl);
            Assert.IsNotEmpty(detailResult.Reviews[0].ProfilePhotoUrl);

            Assert.GreaterOrEqual(detailResult.Reviews[0].Rating, 1);

            Assert.IsNotNull(detailResult.Reviews[0].RelativeTimeDescription);
            Assert.IsNotEmpty(detailResult.Reviews[0].RelativeTimeDescription);

            Assert.IsNotNull(detailResult.Reviews[0].Text);
            Assert.IsNotEmpty(detailResult.Reviews[0].Text);

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            FIELDS_LIST.Clear();
        }
        public void FindPlacesWCLB_ValidQueryWithPlusCode()
        {
            FIELDS_LIST.Add(Places.Fields.PLUS_CODE);

            Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates =
                placesSearch.FindPlacesWithCircularLocationBias(VALID_PHONE_NO,
                                                                Places.InputType.PHONENUMBER, VALID_LOCATION, VALID_RADIUS, FIELDS_LIST);

            candidates.Wait();

            Places.FindPlacesCandidateList candidateList = candidates.Result.Item1;
            Places.FindPlaceCandidates     candidate;
            ResponseStatus status = candidates.Result.Item2;

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            // Verify that the Candidate list is of expected size
            Assert.IsNotNull(candidateList);
            Assert.GreaterOrEqual(candidateList.Candidates.Count, 1);

            // Verify that the place candidate result is as expected
            for (int i = 0; i < candidateList.Candidates.Count; i++)
            {
                candidate = candidateList.Candidates[i];

                Assert.IsNull(candidate.Place_id);
                Assert.IsNull(candidate.Name);

                if (candidate.PlusCode != null)
                {
                    Assert.IsNotNull(candidate.PlusCode.CompoundCode);
                    Assert.IsNotEmpty(candidate.PlusCode.CompoundCode);
                    Assert.IsNotNull(candidate.PlusCode.GlobalCode);
                    Assert.IsNotEmpty(candidate.PlusCode.CompoundCode);

                    FIELDS_LIST.Clear();

                    Assert.Pass("Found at least one candidate with the PlusCode field set");
                }
            }

            Assert.Fail("None of the candidates have the Geometry fields were set. Please verify the query");
        }
예제 #15
0
        public void TextSearchResultsWithOptions_ValidQueryWithAllOptions()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > textResults =
                placesSearch.GetTextSearchResultsWithOptions(PIZZA_QUERY, location: LOCATION_PURDUE,
                                                             radius: RADIUS, type: Places.NearbySearchTypes.MEAL_TAKEAWAY, open_now: true, min_price: 2, max_price: 3);

            textResults.Wait();

            Places.NearbySearchResultList resultsList = textResults.Result.Item1;
            ResponseStatus response = textResults.Result.Item2;

            Assert.IsNotNull(resultsList);
            Assert.GreaterOrEqual(resultsList.Results.Count, 1);

            Assert.AreSame(response, Places.PlacesStatus.OK);

            for (int i = 0; i < resultsList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultsList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                Assert.IsNotNull(result.OpeningHours);

                Assert.GreaterOrEqual(result.PriceLevel, 2);
                Assert.LessOrEqual(result.PriceLevel, 3);

                double dist = BasicFunctions.distanceBetweenLocations(result.Geometry.Location, LOCATION_PURDUE) / 1000.00;
                Assert.LessOrEqual(dist, RADIUS);

                // Verifying Types
                Assert.IsNotNull(result.Types);
                Assert.GreaterOrEqual(result.Types.Count, 1);
                Assert.IsTrue(result.Types.Contains(Places.NearbySearchTypes.MEAL_TAKEAWAY.ToString().ToLower()));
            }
        }
예제 #16
0
        public void FindPlacesWRLB_ValidQueryWithGeometry()
        {
            FIELDS_LIST.Add(Places.Fields.GEOMETRY);

            Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates =
                placesSearch.FindPlacesWithRectLocationBias(PIZZA_QUERY, Places.InputType.TEXTQUERY, SW_LOCATION, NE_LOCATION, FIELDS_LIST);

            candidates.Wait();

            Places.FindPlacesCandidateList candidateList = candidates.Result.Item1;
            Places.FindPlaceCandidates     candidate;
            ResponseStatus status = candidates.Result.Item2;

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            // Verify that the Candidate list is of expected size
            Assert.IsNotNull(candidateList);
            Assert.GreaterOrEqual(candidateList.Candidates.Count, 1);

            // Verify that the place candidate result is as expected
            for (int i = 0; i < candidateList.Candidates.Count; i++)
            {
                candidate = candidateList.Candidates[i];

                Assert.IsNull(candidate.Place_id);
                Assert.IsNull(candidate.Name);

                if (candidate.Geometry != null)
                {
                    Assert.IsNotNull(candidate.Geometry.Viewport);
                    Assert.IsNotNull(candidate.Geometry.Location);

                    FIELDS_LIST.Clear();

                    Assert.Pass("Found at least one item with the Geometry field set");
                }
            }

            Assert.Fail("None of the candidates have the Geometry fields were set. Please verify the query");
        }
        public void FindPlacesUsingTextQuery_ValidRequest()
        {
            Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates =
                placesSearch.FindPlacesUsingTextQuery(VALID_QUERY);

            candidates.Wait();

            Places.FindPlacesCandidateList candidateList = candidates.Result.Item1;
            Places.FindPlaceCandidates     candidate     = candidateList.Candidates[0];
            ResponseStatus status = candidates.Result.Item2;

            // Verify that the Candidate list is of expected size
            Assert.IsNotNull(candidateList);
            Assert.AreEqual(candidateList.Candidates.Count, 1);

            // Verify that the place candidate result is as expected
            Assert.IsNotNull(candidate.Place_id);
            Assert.IsNotEmpty(candidate.Place_id);
            Assert.IsNull(candidate.Name);

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);
        }
예제 #18
0
        public void FindPlacesWRLB_ValidQuery()
        {
            Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates =
                placesSearch.FindPlacesWithRectLocationBias(PIZZA_QUERY, Places.InputType.TEXTQUERY, SW_LOCATION, NE_LOCATION, NULL_LIST);

            candidates.Wait();

            Places.FindPlacesCandidateList candidateList = candidates.Result.Item1;
            Places.FindPlaceCandidates     candidate     = candidateList.Candidates[0];
            ResponseStatus status = candidates.Result.Item2;

            // Verify that the Candidate list is of expected size
            Assert.IsNotNull(candidateList);
            Assert.GreaterOrEqual(candidateList.Candidates.Count, 1);

            // Verify that the place candidate result is as expected
            Assert.IsNotNull(candidate.Place_id);
            Assert.IsNotEmpty(candidate.Place_id);
            Assert.IsNull(candidate.Name);

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);
        }
예제 #19
0
        public void PlacesDetailWithOptions_ValidRequestWithRating()
        {
            FIELDS_LIST.Add(Places.PlacesDetailFields.RATING);

            Task <Tuple <Places.PlacesDetailResponse, ResponseStatus> > details =
                placesDetail.GetPlaceDetailsWithOptions(PLACE_ID_WL, fields: FIELDS_LIST);

            details.Wait();

            Places.PlacesDetailResponse response     = details.Result.Item1;
            Places.PlacesDetailResult   detailResult = response.Result;
            ResponseStatus status = details.Result.Item2;

            // Verify that the result list is of expected size
            Assert.IsNotNull(response);
            Assert.IsNotNull(detailResult);

            Assert.GreaterOrEqual(detailResult.Rating, 0);

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            FIELDS_LIST.Clear();
        }
        public void NearbySearchResultsRBPWithOptions_ValidQueryWithKeyword()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults =
                placesSearch.GetNearbySearchResultsRankByProminenceWithOptions(VALID_LOCATION, SMALL_RADIUS, keyword: THEATER_KEYWORD);

            searchResults.Wait();

            Places.NearbySearchResultList resultList = searchResults.Result.Item1;
            ResponseStatus responseStatus            = searchResults.Result.Item2;

            Assert.AreSame(responseStatus, Places.PlacesStatus.OK);

            Assert.IsNotNull(resultList);
            Assert.GreaterOrEqual(resultList.Results.Count, 1);

            Boolean hasKeyword = false;

            for (int i = 0; i < resultList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);
                if (result.Name.ToLower().Contains(THEATER_KEYWORD))
                {
                    hasKeyword = true;
                }
            }

            Assert.IsTrue(hasKeyword);
        }
        public void NearbySearchAdditionalResults_ValidQuery()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults =
                placesSearch.GetNearbySearchResultsRankByDistanceWithOptions(VALID_LOCATION,
                                                                             keyword: PIZZA_KEYWORD, open_now: true, min_price: 3, max_price: 4);

            searchResults.Wait();

            // Verifying the first page of results
            Places.NearbySearchResultList resultList = searchResults.Result.Item1;
            ResponseStatus responseStatus            = searchResults.Result.Item2;

            Assert.AreSame(responseStatus, Places.PlacesStatus.OK);

            Assert.IsNotNull(resultList);
            Assert.GreaterOrEqual(resultList.Results.Count, 1);

            // Get the next page of results
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults2 =
                placesSearch.GetAdditionalNearbySearchResults(resultList.NextPageToken);

            searchResults2.Wait();

            Boolean photosSet   = false;
            Boolean geometrySet = false;
            Boolean plusCodeSet = false;

            for (int i = 0; i < resultList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                // Verifying Geometry
                if (result.Geometry != null && result.Geometry.Viewport != null && result.Geometry.Location != null)
                {
                    geometrySet = true;
                }

                // Verifying IconHTTP
                Assert.IsNotNull(result.IconHTTP);
                Assert.IsNotEmpty(result.IconHTTP);

                // Verifying ID
                Assert.IsNotNull(result.Id);
                Assert.IsNotEmpty(result.Id);

                // Verifying OpeningHours
                Assert.IsNotNull(result.OpeningHours);
                Assert.IsTrue(result.OpeningHours.OpenNow);

                // Verifying Photos
                if (result.Photos != null && result.Photos.Count >= 1)
                {
                    photosSet = true;
                }

                // Verifying PlusCode
                if (result.PlusCode != null && result.PlusCode.CompoundCode != null && result.PlusCode.GlobalCode != null)
                {
                    plusCodeSet = true;
                }

                // Verifying PriceLevel
                Assert.GreaterOrEqual(result.PriceLevel, 3);
                Assert.LessOrEqual(result.PriceLevel, 4);

                // Verifying Rating
                Assert.GreaterOrEqual(result.Rating, 0);

                // Verifying References
                Assert.IsNotNull(result.Reference);
                Assert.IsNotEmpty(result.Reference);

                // Verifying Scope
                Assert.IsNotNull(result.Scope);
                Assert.IsNotEmpty(result.Scope);

                // Verifying Types
                Assert.IsNotNull(result.Types);
                Assert.GreaterOrEqual(result.Types.Count, 1);

                // Verifying Vicinity
                Assert.IsNotNull(result.Vicinity);
                Assert.IsNotEmpty(result.Vicinity);
            }

            // Verifying that at least one result has each of Photos, PlusCode, and Geometry is set
            Assert.IsTrue(photosSet && plusCodeSet && geometrySet);
        }
        public void TextSearchResults_ValidQuery()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > textResults =
                placesSearch.GetTextSearchResults(VALID_QUERY);

            textResults.Wait();

            Places.NearbySearchResultList resultsList = textResults.Result.Item1;
            ResponseStatus response = textResults.Result.Item2;

            Assert.IsNotNull(resultsList);
            Assert.GreaterOrEqual(resultsList.Results.Count, 1);

            Assert.AreSame(response, Places.PlacesStatus.OK);

            Boolean photosSet       = false;
            Boolean geometrySet     = false;
            Boolean openingHoursSet = false;

            for (int i = 0; i < resultsList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultsList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                // Verifying Photos
                if (result.Photos != null && result.Photos.Count >= 1)
                {
                    photosSet = true;
                }

                //Verifying Geometry
                if (result.Geometry != null && result.Geometry.Viewport != null && result.Geometry.Location != null)
                {
                    geometrySet = true;
                }

                // Verifying Icon
                Assert.IsNotNull(result.IconHTTP);
                Assert.IsNotEmpty(result.IconHTTP);

                // Verifying Id
                Assert.IsNotNull(result.Id);
                Assert.IsNotEmpty(result.Id);

                // Verifying Types
                Assert.IsNotNull(result.Types);
                Assert.GreaterOrEqual(result.Types.Count, 1);

                // Verifying OpeningHours
                if (result.OpeningHours != null)
                {
                    openingHoursSet = true;
                }
            }

            Assert.IsTrue(openingHoursSet && photosSet && geometrySet);
        }
        public void FindPlacesWPLB_ValidQueryWithAllFields()
        {
            FIELDS_LIST.Add(Places.Fields.FORMATTED_ADDRESS);
            FIELDS_LIST.Add(Places.Fields.GEOMETRY);
            FIELDS_LIST.Add(Places.Fields.ICON);
            FIELDS_LIST.Add(Places.Fields.ID);
            FIELDS_LIST.Add(Places.Fields.NAME);
            FIELDS_LIST.Add(Places.Fields.OPENING_HOURS);
            FIELDS_LIST.Add(Places.Fields.PHOTOS);
            FIELDS_LIST.Add(Places.Fields.PLACE_ID);
            FIELDS_LIST.Add(Places.Fields.PLUS_CODE);
            FIELDS_LIST.Add(Places.Fields.PRICE_LEVEL);
            FIELDS_LIST.Add(Places.Fields.RATING);
            FIELDS_LIST.Add(Places.Fields.TYPES);

            Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates =
                placesSearch.FindPlaceWithPointLocationBias(MUSEUM_QUERY, VALID_LOCATION, FIELDS_LIST);

            candidates.Wait();

            Places.FindPlacesCandidateList candidateList = candidates.Result.Item1;
            Places.FindPlaceCandidates     candidate     = candidateList.Candidates[0];
            ResponseStatus status = candidates.Result.Item2;

            // Verify that the Candidate list is of expected size
            Assert.IsNotNull(candidateList);
            Assert.AreEqual(candidateList.Candidates.Count, 1);

            // Verify that the place candidate result is as expected

            // Verifying Place_id
            Assert.IsNotNull(candidate.Place_id);
            Assert.IsNotEmpty(candidate.Place_id);

            // Verifying Name
            Assert.IsNotNull(candidate.Name);
            Assert.IsNotEmpty(candidate.Name);
            Assert.IsTrue(candidate.Name.ToLower().Contains(MUSEUM_QUERY.ToLower()));

            // Verifying Photos
            Assert.IsNotNull(candidate.Photos);
            Assert.GreaterOrEqual(candidate.Photos.Count, 1);

            // Verifying Formatted_address
            Assert.IsNotNull(candidate.Formatted_address);
            Assert.IsTrue(candidate.Formatted_address.Contains("New York"));

            //Verifying Geometry
            Assert.IsNotNull(candidate.Geometry);
            Assert.IsNotNull(candidate.Geometry.Viewport);
            Assert.IsNotNull(candidate.Geometry.Location);

            // Verifying Icon
            Assert.IsNotNull(candidate.Icon);
            Assert.IsNotEmpty(candidate.Icon);

            // Verifying Id
            Assert.IsNotNull(candidate.Id);
            Assert.IsNotEmpty(candidate.Id);

            // Verifying PlusCode
            Assert.IsNotNull(candidate.PlusCode);
            Assert.IsNotNull(candidate.PlusCode.CompoundCode);
            Assert.IsNotEmpty(candidate.PlusCode.CompoundCode);
            Assert.IsNotNull(candidate.PlusCode.GlobalCode);
            Assert.IsNotEmpty(candidate.PlusCode.CompoundCode);

            // Verifying Types
            Assert.IsNotNull(candidate.Types);
            Assert.GreaterOrEqual(candidate.Types.Count, 1);

            // Verifying Rating
            Assert.GreaterOrEqual(candidate.Rating, 0);

            // Verifying OpeningHours
            Assert.IsNotNull(candidate.OpeningHours);

            // Verifying PriceLevel
            Assert.GreaterOrEqual(candidate.PriceLevel, 0);

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            FIELDS_LIST.Clear();
        }
        public void NearbySearchResultsRBD_ValidQueryWithKeyword()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults =
                placesSearch.GetNearbySearchResultsRankByDistance(VALID_LOCATION, keyword: PIZZA_KEYWORD);

            searchResults.Wait();

            Places.NearbySearchResultList resultList = searchResults.Result.Item1;
            ResponseStatus responseStatus            = searchResults.Result.Item2;

            Assert.AreSame(responseStatus, Places.PlacesStatus.OK);

            Assert.IsNotNull(resultList);
            Assert.GreaterOrEqual(resultList.Results.Count, 1);

            Boolean photosSet       = false;
            Boolean geometrySet     = false;
            Boolean openingHoursSet = false;

            for (int i = 0; i < resultList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                // Verifying Photos
                if (result.Photos != null && result.Photos.Count >= 1)
                {
                    photosSet = true;
                }

                //Verifying Geometry
                if (result.Geometry != null && result.Geometry.Viewport != null && result.Geometry.Location != null)
                {
                    geometrySet = true;
                }

                // Verifying Icon
                Assert.IsNotNull(result.IconHTTP);
                Assert.IsNotEmpty(result.IconHTTP);

                // Verifying Id
                Assert.IsNotNull(result.Id);
                Assert.IsNotEmpty(result.Id);

                // Verifying Types
                Assert.IsNotNull(result.Types);
                Assert.GreaterOrEqual(result.Types.Count, 1);

                // Verifying OpeningHours
                if (result.OpeningHours != null)
                {
                    openingHoursSet = true;
                }
            }

            Assert.IsTrue(openingHoursSet && photosSet && geometrySet);
        }
예제 #25
0
        public void PlacesDetailWithOptions_ValidRequestWithAllOptions()
        {
            FIELDS_LIST.Add(Places.PlacesDetailFields.ADDRESS_COMPONENT);
            FIELDS_LIST.Add(Places.PlacesDetailFields.ADR_ADDRESS);
            FIELDS_LIST.Add(Places.PlacesDetailFields.FORMATTED_ADDRESS);
            FIELDS_LIST.Add(Places.PlacesDetailFields.FORMATTED_PHONE_NUMBER);
            FIELDS_LIST.Add(Places.PlacesDetailFields.GEOMETRY);
            FIELDS_LIST.Add(Places.PlacesDetailFields.ICON);
            FIELDS_LIST.Add(Places.PlacesDetailFields.ID);
            FIELDS_LIST.Add(Places.PlacesDetailFields.INTERNATIONAL_PHONE_NUMBER);
            FIELDS_LIST.Add(Places.PlacesDetailFields.NAME);
            FIELDS_LIST.Add(Places.PlacesDetailFields.OPENING_HOURS);
            FIELDS_LIST.Add(Places.PlacesDetailFields.PHOTOS);
            FIELDS_LIST.Add(Places.PlacesDetailFields.PLACE_ID);
            FIELDS_LIST.Add(Places.PlacesDetailFields.PLUS_CODE);
            FIELDS_LIST.Add(Places.PlacesDetailFields.PRICE_LEVEL);
            FIELDS_LIST.Add(Places.PlacesDetailFields.RATING);
            FIELDS_LIST.Add(Places.PlacesDetailFields.REVIEW);
            FIELDS_LIST.Add(Places.PlacesDetailFields.SCOPE);
            FIELDS_LIST.Add(Places.PlacesDetailFields.TYPES);
            FIELDS_LIST.Add(Places.PlacesDetailFields.URL);
            FIELDS_LIST.Add(Places.PlacesDetailFields.UTC_OFFSET);
            FIELDS_LIST.Add(Places.PlacesDetailFields.VICINITY);
            FIELDS_LIST.Add(Places.PlacesDetailFields.WEBSITE);

            Task <Tuple <Places.PlacesDetailResponse, ResponseStatus> > details =
                placesDetail.GetPlaceDetailsWithOptions(PLACE_ID_NYC, fields: FIELDS_LIST);

            details.Wait();

            Places.PlacesDetailResponse response     = details.Result.Item1;
            Places.PlacesDetailResult   detailResult = response.Result;
            ResponseStatus status = details.Result.Item2;

            // Verify that theresult list is of expected size
            Assert.IsNotNull(response);
            Assert.IsNotNull(detailResult);

            // Verifying AddressComponents
            Assert.IsNotNull(detailResult.AddressComponents);
            Assert.GreaterOrEqual(detailResult.AddressComponents.Count, 1);

            // Verifying AdrAddress
            Assert.IsNotNull(detailResult.AdrAddress);
            Assert.IsNotEmpty(detailResult.AdrAddress);

            // Verifying FormattedAddress
            Assert.IsNotNull(detailResult.FormattedAddress);
            Assert.IsNotEmpty(detailResult.FormattedAddress);

            // Verifying FormattedPhoneNumber
            Assert.IsNotNull(detailResult.FormattedPhoneNumber);
            Assert.IsNotEmpty(detailResult.FormattedPhoneNumber);

            // Verifying Geometry
            Assert.IsNotNull(detailResult.Geometry);
            Assert.IsNotNull(detailResult.Geometry.Location);
            Assert.IsNotNull(detailResult.Geometry.Viewport);

            // Verifying Icon
            Assert.IsNotNull(detailResult.Icon);
            Assert.IsNotEmpty(detailResult.Icon);

            // Verifying InternationalPhoneNumber
            Assert.IsNotNull(detailResult.InternationalPhoneNumber);
            Assert.IsNotEmpty(detailResult.InternationalPhoneNumber);

            // Verifying Name
            Assert.IsNotNull(detailResult.Name);
            Assert.IsNotEmpty(detailResult.Name);

            // Verifying OpeningHours
            Assert.IsNotNull(detailResult.OpeningHours);

            Assert.IsNotNull(detailResult.OpeningHours.Periods);
            Assert.GreaterOrEqual(detailResult.OpeningHours.Periods.Count, 1);

            Assert.IsNotNull(detailResult.OpeningHours.WeekdayText);
            Assert.GreaterOrEqual(detailResult.OpeningHours.WeekdayText.Count, 1);

            // Verifying PlaceId
            Assert.IsNotNull(detailResult.PlaceId);
            Assert.IsNotEmpty(detailResult.PlaceId);
            Assert.AreEqual(detailResult.PlaceId, PLACE_ID_NYC);

            // Verifying PlusCode
            Assert.IsNotNull(detailResult.PlusCode);

            Assert.IsNotNull(detailResult.PlusCode.CompoundCode);
            Assert.IsNotEmpty(detailResult.PlusCode.CompoundCode);

            Assert.IsNotNull(detailResult.PlusCode.GlobalCode);
            Assert.IsNotEmpty(detailResult.PlusCode.GlobalCode);

            // Verifying Photos
            Assert.IsNotNull(detailResult.Photos);
            Assert.GreaterOrEqual(detailResult.Photos.Count, 1);

            // Verifying Reviews
            Assert.IsNotNull(detailResult.Reviews);
            Assert.GreaterOrEqual(detailResult.Reviews.Count, 1);

            Assert.IsNotNull(detailResult.Reviews[0].AuthorName);
            Assert.IsNotEmpty(detailResult.Reviews[0].AuthorName);

            Assert.IsNotNull(detailResult.Reviews[0].AuthorUrl);
            Assert.IsNotEmpty(detailResult.Reviews[0].AuthorUrl);

            Assert.IsNotNull(detailResult.Reviews[0].Language);
            Assert.IsNotEmpty(detailResult.Reviews[0].Language);

            Assert.IsNotNull(detailResult.Reviews[0].ProfilePhotoUrl);
            Assert.IsNotEmpty(detailResult.Reviews[0].ProfilePhotoUrl);

            Assert.GreaterOrEqual(detailResult.Reviews[0].Rating, 1);

            Assert.IsNotNull(detailResult.Reviews[0].RelativeTimeDescription);
            Assert.IsNotEmpty(detailResult.Reviews[0].RelativeTimeDescription);

            Assert.IsNotNull(detailResult.Reviews[0].Text);
            Assert.IsNotEmpty(detailResult.Reviews[0].Text);

            // Verifying Scope
            Assert.IsNotNull(detailResult.Scope);
            Assert.IsNotEmpty(detailResult.Scope);

            // Verifying Types
            Assert.IsNotNull(detailResult.Types);
            Assert.GreaterOrEqual(detailResult.Types.Count, 1);

            // Verifying Url
            Assert.IsNotNull(detailResult.Url);
            Assert.IsNotEmpty(detailResult.Url);

            // Verifying UTC_Offset
            Assert.IsNotNull(detailResult.UtcOffset);
            Assert.GreaterOrEqual(detailResult.UtcOffset, -12 * 60);
            Assert.LessOrEqual(detailResult.UtcOffset, 12 * 60);

            // Verifying Vicinity
            Assert.IsNotNull(detailResult.Vicinity);
            Assert.IsNotEmpty(detailResult.Vicinity);

            // Verifying Website
            Assert.IsNotNull(detailResult.Website);
            Assert.IsNotEmpty(detailResult.Website);

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            FIELDS_LIST.Clear();
        }
        public void TextSearchAdditionalResults_ValidQuery()
        {
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > textResults =
                placesSearch.GetTextSearchResultsWithOptions(FOOD_QUERY, location: LOCATION_NYC,
                                                             radius: RADIUS, type: Places.NearbySearchTypes.MEAL_DELIVERY, open_now: true, min_price: 0, max_price: 4);

            textResults.Wait();

            Places.NearbySearchResultList resultsList = textResults.Result.Item1;
            ResponseStatus response = textResults.Result.Item2;

            Assert.IsNotNull(resultsList);
            Assert.GreaterOrEqual(resultsList.Results.Count, 1);

            Assert.AreSame(response, Places.PlacesStatus.OK);

            // Get the next page of results
            Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults2 =
                placesSearch.GetAdditionalTextSearchResults(resultsList.NextPageToken);

            searchResults2.Wait();

            Boolean photosSet   = false;
            Boolean geometrySet = false;
            Boolean plusCodeSet = false;

            for (int i = 0; i < resultsList.Results.Count; i++)
            {
                Places.NearbySearchResult result = resultsList.Results[i];

                // Verifying Place_id
                Assert.IsNotNull(result.Place_id);
                Assert.IsNotEmpty(result.Place_id);

                // Verifying Name
                Assert.IsNotNull(result.Name);
                Assert.IsNotEmpty(result.Name);

                Assert.GreaterOrEqual(result.PriceLevel, 0);
                Assert.LessOrEqual(result.PriceLevel, 4);

                double dist = BasicFunctions.distanceBetweenLocations(result.Geometry.Location, LOCATION_NYC) / 1000.00;
                Assert.LessOrEqual(dist, RADIUS);

                // Verifying Types
                Assert.IsNotNull(result.Types);
                Assert.GreaterOrEqual(result.Types.Count, 1);
                Assert.IsTrue(result.Types.Contains(Places.NearbySearchTypes.MEAL_DELIVERY.ToString().ToLower()));

                // Verifying Geometry
                if (result.Geometry != null && result.Geometry.Viewport != null && result.Geometry.Location != null)
                {
                    geometrySet = true;
                }

                // Verifying IconHTTP
                Assert.IsNotNull(result.IconHTTP);
                Assert.IsNotEmpty(result.IconHTTP);

                // Verifying ID
                Assert.IsNotNull(result.Id);
                Assert.IsNotEmpty(result.Id);

                // Verifying OpeningHours
                Assert.IsNotNull(result.OpeningHours);
                Assert.IsTrue(result.OpeningHours.OpenNow);

                // Verifying Photos
                if (result.Photos != null && result.Photos.Count >= 1)
                {
                    photosSet = true;
                }

                // Verifying PlusCode
                if (result.PlusCode != null && result.PlusCode.CompoundCode != null && result.PlusCode.GlobalCode != null)
                {
                    plusCodeSet = true;
                }

                // Verifying Rating
                Assert.GreaterOrEqual(result.Rating, 0);

                // Verifying References
                Assert.IsNotNull(result.Reference);
                Assert.IsNotEmpty(result.Reference);

                // Verifying Types
                Assert.IsNotNull(result.Types);
                Assert.GreaterOrEqual(result.Types.Count, 1);
                Assert.IsTrue(result.Types.Contains(Places.NearbySearchTypes.MEAL_DELIVERY.ToString().ToLower()));
            }

            // Verifying that at least one result has each of Photos, PlusCode, and Geometry is set
            Assert.IsTrue(photosSet && plusCodeSet && geometrySet);
        }
        public void FindPlacesWCLB_ValidQueryWithAllFields()
        {
            FIELDS_LIST.Add(Places.Fields.FORMATTED_ADDRESS);
            FIELDS_LIST.Add(Places.Fields.GEOMETRY);
            FIELDS_LIST.Add(Places.Fields.ICON);
            FIELDS_LIST.Add(Places.Fields.ID);
            FIELDS_LIST.Add(Places.Fields.NAME);
            FIELDS_LIST.Add(Places.Fields.OPENING_HOURS);
            FIELDS_LIST.Add(Places.Fields.PHOTOS);
            FIELDS_LIST.Add(Places.Fields.PLACE_ID);
            FIELDS_LIST.Add(Places.Fields.PLUS_CODE);
            FIELDS_LIST.Add(Places.Fields.PRICE_LEVEL);
            FIELDS_LIST.Add(Places.Fields.RATING);
            FIELDS_LIST.Add(Places.Fields.TYPES);

            Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates =
                placesSearch.FindPlacesWithCircularLocationBias(VALID_PHONE_NO,
                                                                Places.InputType.PHONENUMBER, VALID_LOCATION, VALID_RADIUS, FIELDS_LIST);

            candidates.Wait();

            Places.FindPlacesCandidateList candidateList = candidates.Result.Item1;
            Places.FindPlaceCandidates     candidate;
            ResponseStatus status = candidates.Result.Item2;

            // Verify that the Candidate list is of expected size
            Assert.IsNotNull(candidateList);
            Assert.GreaterOrEqual(candidateList.Candidates.Count, 1);

            Boolean photosSet       = false;
            Boolean geometrySet     = false;
            Boolean plusCodeSet     = false;
            Boolean openingHoursSet = false;

            // Verify that the place candidate result is as expected

            for (int i = 0; i < candidateList.Candidates.Count; i++)
            {
                candidate = candidateList.Candidates[i];

                // Verifying Place_id
                Assert.IsNotNull(candidate.Place_id);
                Assert.IsNotEmpty(candidate.Place_id);

                // Verifying Name
                Assert.IsNotNull(candidate.Name);
                Assert.IsNotEmpty(candidate.Name);

                // Verifying Photos
                if (candidate.Photos != null && candidate.Photos.Count >= 1)
                {
                    photosSet = true;
                }

                // Verifying Formatted_address
                Assert.IsNotNull(candidate.Formatted_address);

                //Verifying Geometry
                if (candidate.Geometry != null && candidate.Geometry.Viewport != null && candidate.Geometry.Location != null)
                {
                    geometrySet = true;
                }

                // Verifying Icon
                Assert.IsNotNull(candidate.Icon);
                Assert.IsNotEmpty(candidate.Icon);

                // Verifying Id
                Assert.IsNotNull(candidate.Id);
                Assert.IsNotEmpty(candidate.Id);

                // Verifying PlusCode
                if (candidate.PlusCode != null && candidate.PlusCode.CompoundCode != null && candidate.PlusCode.GlobalCode != null)
                {
                    plusCodeSet = true;
                }

                // Verifying Types
                Assert.IsNotNull(candidate.Types);
                Assert.GreaterOrEqual(candidate.Types.Count, 1);

                // Verifying Rating
                Assert.GreaterOrEqual(candidate.Rating, 0);

                // Verifying OpeningHours
                if (candidate.OpeningHours != null)
                {
                    openingHoursSet = true;
                }

                // Verifying PriceLevel
                Assert.GreaterOrEqual(candidate.PriceLevel, 0);
            }

            Assert.IsTrue(openingHoursSet && plusCodeSet && photosSet && geometrySet);

            // Verify that the Status returned for the request is OK
            Assert.AreSame(status, Places.PlacesStatus.OK);

            FIELDS_LIST.Clear();
        }