public void TextSearchResults_InvalidAPIKey() { placesSearch.UpdateKey(INVALID_SETUP); Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > textResults = placesSearch.GetTextSearchResults(PIZZA_QUERY); textResults.Wait(); // Reverting to a valid API Key before we run any tests placesSearch.UpdateKey(VALID_SETUP); Assert.IsNull(textResults.Result.Item1); Assert.AreSame(textResults.Result.Item2, Places.PlacesStatus.INVALID_API_KEY); }
public void NearbySearchResultsRBP_InvalidAPIKey() { placesSearch.UpdateKey(INVALID_SETUP); Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults = placesSearch.GetNearbySearchResultsRankByProminence(GENERIC_LOCATION, VALID_RADIUS); searchResults.Wait(); // Reverting to a valid API Key before we run any tests on the data returned. placesSearch.UpdateKey(VALID_SETUP); Assert.IsNull(searchResults.Result.Item1); Assert.AreSame(searchResults.Result.Item2, Places.PlacesStatus.INVALID_API_KEY); }
public void TextSearchAdditionalResults_InvalidAPIKey() { placesSearch.UpdateKey(INVALID_SETUP); Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults = placesSearch.GetAdditionalTextSearchResults(GENERIC_PAGE_TOKEN); searchResults.Wait(); // Reverting to the Valid API Key before we run any tests placesSearch.UpdateKey(VALID_SETUP); Assert.IsNull(searchResults.Result.Item1); Assert.AreEqual(searchResults.Result.Item2, Places.PlacesStatus.INVALID_API_KEY); }
public void NearbySearchAdditionalResults_InvalidAPIKey() { placesSearch.UpdateKey(INVALID_SETUP); Task <Tuple <Places.NearbySearchResultList, ResponseStatus> > searchResults = placesSearch.GetAdditionalNearbySearchResults(GENERIC_PAGE_TOKEN); searchResults.Wait(); /* * Revert the setup to a valid one before running any assert. This is important because doing so * ensures that a failed assert in this test will not cause fall through error in the following tests. */ placesSearch.UpdateKey(VALID_SETUP); Assert.IsNull(searchResults.Result.Item1); Assert.AreEqual(searchResults.Result.Item2, Places.PlacesStatus.INVALID_API_KEY); }
public void FindPlacesWPLB_InvalidAPIKey() { placesSearch.UpdateKey(INVALID_SETUP); Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates = placesSearch.FindPlaceWithPointLocationBias(PIZZA_QUERY, GENERIC_LOCATION, NULL_LIST); candidates.Wait(); /* * Revert the setup to a valid one before running any assert. This is important because doing so * ensures that a failed assert in this test will not cause fall through error in the following tests. */ placesSearch.UpdateKey(VALID_SETUP); Assert.IsNull(candidates.Result.Item1); Assert.AreEqual(candidates.Result.Item2, Places.PlacesStatus.INVALID_API_KEY); }
public void FindPlacesUsingTextQuery_InvalidAPIKey() { // Temporarily modify the class to have an invalid API Key placesSearch.UpdateKey(INVALID_SETUP); Task <Tuple <Places.FindPlacesCandidateList, ResponseStatus> > candidates = placesSearch.FindPlacesUsingTextQuery(PIZZA_QUERY); candidates.Wait(); /* * Revert the setup to a valid one before running any assert. This is important because doing so * ensures that a failed assert in this test will not cause fall through error in the following tests. */ placesSearch.UpdateKey(VALID_SETUP); // Verifying that the function returned the expected error Assert.IsNull(candidates.Result.Item1); Assert.AreEqual(candidates.Result.Item2, Places.PlacesStatus.INVALID_API_KEY); }