예제 #1
0
        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"));
        }
예제 #2
0
        public void UserActivity_Fail_ServerToken()
        {
            var client = new UberClient("");

            Assert.That(async() => await client.UserActivityAsync(), Throws.InstanceOf <ArgumentException>());
        }
예제 #3
0
 public void UserActivity_Fail_ServerToken()
 {
     var client = new UberClient("");
     Assert.That(async () => await client.UserActivityAsync(), Throws.InstanceOf<ArgumentException>());
 }