コード例 #1
0
        public void Test_0001_ChangePassword_wrongPassword()
        {
            this.LogIn();

            string newPassword = "******";
            string oldPassword = "******";

            // set Response
            client.AddResponse(new CloudException(401,
                                                  "{" +
                                                  "\"errorCode\" : \"WRONG_PASSWORD\"," +
                                                  "\"message\" : \"The provided password is wrong\"," +
                                                  "\"appID\" : \"appId\"," +
                                                  "\"userID\" : \"86f3cdcf-950d-4d26-aa1c-443573de1736\"," +
                                                  "\"suppressed\" : [ ]" +
                                                  "}"));

            bool      done      = false;
            Exception exception = null;

            KiiUser.ChangePassword(newPassword, oldPassword, (Exception e) =>
            {
                done      = true;
                exception = e;
            });

            Assert.IsTrue(done);
            Assert.IsNotNull(exception);
            Assert.IsTrue(exception is CloudException);
        }
コード例 #2
0
        public void Test_0010_ChangePassword_newPassword_null()
        {
            this.LogIn();

            string newPassword = null;
            string oldPassword = "******";

            // set Response
            client.AddResponse(204, "");

            KiiUser.ChangePassword(newPassword, oldPassword);
        }
コード例 #3
0
    void PerformChangePassword(string oldPassword, string newPassword)
    {
        message       = "Changing password...";
        ButtonEnabled = false;

        KiiUser.ChangePassword(newPassword, oldPassword, (Exception e) =>
        {
            ButtonEnabled = true;
            if (e != null)
            {
                message = "Failed to change password " + e.ToString();
                return;
            }
            PerformBack();
        });
    }
コード例 #4
0
        public void Test_0001_ChangePassword_wrongPassword()
        {
            this.LogIn();

            string newPassword = "******";
            string oldPassword = "******";

            // set Response
            client.AddResponse(new CloudException(401,
                                                  "{" +
                                                  "\"errorCode\" : \"WRONG_PASSWORD\"," +
                                                  "\"message\" : \"The provided password is wrong\"," +
                                                  "\"appID\" : \"appId\"," +
                                                  "\"userID\" : \"86f3cdcf-950d-4d26-aa1c-443573de1736\"," +
                                                  "\"suppressed\" : [ ]" +
                                                  "}"));

            KiiUser.ChangePassword(newPassword, oldPassword);
        }
コード例 #5
0
        public void Test_0000_ChangePassword()
        {
            this.LogIn();

            string newPassword = "******";
            string oldPassword = "******";

            // set Response
            client.AddResponse(204, "");

            bool      done      = false;
            Exception exception = null;

            KiiUser.ChangePassword(newPassword, oldPassword, (Exception e) =>
            {
                done      = true;
                exception = e;
            });

            Assert.IsTrue(done);
            Assert.IsNull(exception);
        }