public async Task PriceEstimates() { var client = new UberClient(_serverKey); var results = await client.PriceEstimateAsync(latitude, longitude, latitude + 0.3F, longitude - 0.3F); Assert.IsNotNull(results); }
public async Task TimeEstimates() { var client = new UberClient(_serverKey); var results = await client.TimeEstimateAsync(latitude, longitude); Assert.IsNotNull(results); }
public void UberRequest() { var client = new UberClient("bcOz4z-GbY3kIGEha6wWMfzbZDOCZNdB"); //Uber Login string url = Common.FormatAuthorizeUrl(ResponseTypes.Code, "bcOz4z-GbY3kIGEha6wWMfzbZDOCZNdB", HttpUtility.UrlEncode("YOURCALLBACKURL")); //var tw //return Redirect(url); //HttpR.Redirect(url,false); //Access Token Authentication //var auth = new AuthenticationClient(); //await auth.WebServerAsync(_clientId, _clientSecret, _callbackUrl, code); //Initialize Client //client = new UberClient(TokenTypes.Access, auth.AccessToken); }
public async Task Products() { var client = new UberClient(_serverKey); var results = await client.ProductsAsync(latitude, longitude); Assert.IsNotNull(results); }
public async Task ResponseHeaders_NotNull() { var client = new UberClient(_serverKey); await client.ProductsAsync(latitude, longitude); Assert.IsNotNull(client.RateLimitRemaining); Assert.IsNotNull(client.Etag); Assert.IsNotNull(client.RateLimitReset); Assert.IsNotNull(client.RateLimitLimit); Assert.IsNotNull(client.UberApp); }
public async Task TimeEstimates_Product() { var client = new UberClient(_serverKey); var productResults = await client.ProductsAsync(latitude, longitude); var product = productResults.products.FirstOrDefault(); if (product != null) { var results = await client.TimeEstimateAsync(latitude, longitude, productId : product.product_id); Assert.IsNotNull(results); } }
public async Task <ActionResult> Callback(string code) { var auth = new AuthenticationClient(); await auth.WebServerAsync(_clientId, _clientSecret, _callbackUrl, code); Session["ApiVersion"] = auth.ApiVersion; Session["AccessToken"] = auth.AccessToken; Session["RefreshToken"] = auth.RefreshToken; var client = new UberClient(TokenTypes.Access, auth.AccessToken, "v1", new HttpClient()); var userActivity = await client.UserActivityAsync(); var user = await client.UserAsync(); return(RedirectToAction("Index", "Home")); }
public async Task TimeEstimates_Product() { var client = new UberClient(_serverKey); var productResults = await client.ProductsAsync(latitude, longitude); var product = productResults.products.FirstOrDefault(); if (product != null) { var results = await client.TimeEstimateAsync(latitude, longitude, productId: product.product_id); Assert.IsNotNull(results); } }
public void UserActivity_Fail_ServerToken() { var client = new UberClient(""); Assert.That(async() => await client.UserActivityAsync(), Throws.InstanceOf <ArgumentException>()); }
public void UserActivity_Fail_ServerToken() { var client = new UberClient(""); Assert.That(async () => await client.UserActivityAsync(), Throws.InstanceOf<ArgumentException>()); }