示例#1
0
        public void GetLocationDetails()
        {
            IQueryMerchantData queryClient = ClientModuleIntegrationTestingUtilities.GetSandboxedLevelUpModule <IQueryMerchantData>();
            var locationDetails            = queryClient.GetLocationDetails(ClientModuleIntegrationTestingUtilities.SandboxedLevelUpMerchantAccessToken,
                                                                            LevelUpTestConfiguration.Current.MerchantLocationId);

            Assert.AreEqual(locationDetails.MerchantId, LevelUpTestConfiguration.Current.MerchantId);
        }
示例#2
0
        public void GetLocationDetailsShouldSucceed()
        {
            const int locationId = 17;

            string expectedRequestUrl = ClientModuleFunctionalTestingUtilities.SANDBOX_URL_PREFIX + "/v15/locations/" + locationId;

            RestResponse expectedResponse = new RestResponse
            {
                StatusCode = HttpStatusCode.OK,
                Content    = string.Format("{{" +
                                           "\"location\": {{" +
                                           "\"categories\": [" +
                                           "50" +
                                           "]," +
                                           "\"extended_address\": \"\"," +
                                           "\"facebook_url\": \"http://www.facebook.com/pages/PizzaPalace\"," +
                                           "\"foodler_url\": \"http://deeplink.me/www.foodler.com/pizza-palace/1234\"," +
                                           "\"hours\": null," +
                                           "\"id\": {0}," +
                                           "\"latitude\": 42.351639," +
                                           "\"locality\": \"Boston\"," +
                                           "\"longitude\": -71.121797," +
                                           "\"menu_url\": null," +
                                           "\"merchant_id\": 18," +
                                           "\"merchant_description_html\": \"This is a place that has pizza!\"," +
                                           "\"merchant_name\": \"Pizza Palace\"," +
                                           "\"merchant_tip_preference\": \"no preference\"," +
                                           "\"name\": null," +
                                           "\"newsletter_url\": null," +
                                           "\"opentable_url\": null," +
                                           "\"phone\": null," +
                                           "\"postal_code\": \"02215\"," +
                                           "\"region\": \"MA\"," +
                                           "\"street_address\": \"1024 Pizza Road\"," +
                                           "\"twitter_url\": null," +
                                           "\"updated_at\": \"2014-11-30T10:28:23-05:00\"," +
                                           "\"yelp_url\": \"http://www.yelp.com/biz/pizza-palace\"," +
                                           "\"shown\": true" +
                                           "}}" +
                                           "}}", locationId)
            };

            IQueryMerchantData client = ClientModuleFunctionalTestingUtilities.GetMockedLevelUpModule <IQueryMerchantData>(
                expectedResponse, expectedRequestUrl: expectedRequestUrl);
            var details = client.GetLocationDetails("not_checking_this", locationId);

            Assert.AreEqual(details.LocationId, locationId);
            Assert.AreEqual(details.Address.PostalCode, "02215");
        }