예제 #1
0
        public Task TestLogInByMobileWithPassword()
        {
            var pwd = Utils.RandomString(10);

            return(Utils.SignUp(pwd).ContinueWith(_ =>
            {
                var user = _.Result;
                return AVUser.LogInByMobilePhoneNumberAsync(user.MobilePhoneNumber, pwd).ContinueWith(t =>
                {
                    Assert.False(t.IsCanceled);
                    if (t.IsFaulted)
                    {
                        Assert.IsTrue(t.Exception.InnerException is AVException);
                        var avError = t.Exception.InnerException as AVException;
                        Assert.Equals(avError.Code, 603);
                    }
                    else
                    {
                        Assert.IsNotNull(user.ObjectId);
                    }
                });
            }));
        }