コード例 #1
0
        public void PlacesDetailWithOptions_ValidRequestWithWebsite()
        {
            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 the result list is of expected size
            Assert.IsNotNull(response);
            Assert.IsNotNull(detailResult);

            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();
        }
コード例 #2
0
        public void PlacesDetailWithOptions_ValidRequestWithUTCOffset()
        {
            FIELDS_LIST.Add(Places.PlacesDetailFields.UTC_OFFSET);

            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.UtcOffset);
            Assert.GreaterOrEqual(detailResult.UtcOffset, -12 * 60);
            Assert.LessOrEqual(detailResult.UtcOffset, 12 * 60);

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

            FIELDS_LIST.Clear();
        }
コード例 #3
0
        public void PlacesDetailWithOptions_ValidRequestWithAddressComponent()
        {
            FIELDS_LIST.Add(Places.PlacesDetailFields.ADDRESS_COMPONENT);

            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.IsNotNull(detailResult.AddressComponents);
            Assert.GreaterOrEqual(detailResult.AddressComponents.Count, 1);

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

            FIELDS_LIST.Clear();
        }
コード例 #4
0
        public void PlacesDetailWithOptions_ValidRequestWithOpeningHours()
        {
            FIELDS_LIST.Add(Places.PlacesDetailFields.OPENING_HOURS);

            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.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);

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

            FIELDS_LIST.Clear();
        }
コード例 #5
0
        public void PlacesDetailWithOptions_ValidRequestWithGeometry()
        {
            FIELDS_LIST.Add(Places.PlacesDetailFields.GEOMETRY);

            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.IsNotNull(detailResult.Geometry);
            Assert.IsNotNull(detailResult.Geometry.Location);
            Assert.IsNotNull(detailResult.Geometry.Viewport);

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

            FIELDS_LIST.Clear();
        }
コード例 #6
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);
        }
コード例 #7
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();
        }
コード例 #8
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();
        }