Exemple #1
0
    public IEnumerator HandleBootAuthFailed()
    {
        Autoya.forceFailFirstBoot = true;

        Autoya.Auth_Logout();

        var bootAuthFailHandled = false;

        Autoya.Auth_SetOnBootAuthFailed(
            (code, reason) =>
        {
            bootAuthFailHandled = true;
        }
            );

        Autoya.Auth_AttemptAuthenticationIfNeed();

        yield return(WaitUntil(
                         () => bootAuthFailHandled,
                         () => { throw new TimeoutException("failed to handle bootAuthFailed."); },
                         10
                         ));

        Autoya.forceFailFirstBoot = false;
    }
    [MTest] public void IntentionalLogout()
    {
        Autoya.Auth_Logout();

        var loggedIn = Autoya.Auth_IsAuthenticated();

        Assert(!loggedIn, "state does not match.");
    }
Exemple #3
0
    public IEnumerator IntentionalLogout()
    {
        Autoya.Auth_Logout();

        var loggedIn = Autoya.Auth_IsAuthenticated();

        True(!loggedIn, "state does not match.");
        yield break;
    }
Exemple #4
0
    public IEnumerator HandleLogoutThenAuthenticationAttemptSucceeded()
    {
        Autoya.Auth_Logout();

        Autoya.Auth_AttemptAuthenticationIfNeed();

        yield return(WaitUntil(
                         () => Autoya.Auth_IsAuthenticated(),
                         () => { throw new TimeoutException("failed to auth"); }
                         ));
    }
    [MTest] public void HandleLogoutThenAuthenticationAttemptSucceeded()
    {
        Autoya.Auth_Logout();

        RunOnMainThread(
            () => Autoya.Auth_AttemptAuthentication()
            );

        WaitUntil(
            () => Autoya.Auth_IsAuthenticated(),
            5,
            "failed to auth"
            );
    }
Exemple #6
0
    public IEnumerator DeleteAllUserData()
    {
        Autoya.Auth_Logout();

        var authenticated = Autoya.Auth_IsAuthenticated();

        True(!authenticated, "not deleted.");

        Autoya.Auth_AttemptAuthenticationIfNeed();

        yield return(WaitUntil(
                         () => Autoya.Auth_IsAuthenticated(),
                         () => { throw new TimeoutException("failed to firstBoot."); }
                         ));
    }
    public IEnumerator IntentionalLogout()
    {
        var logouted = false;

        Autoya.Auth_Logout(() => { logouted = true; }, reason => { });
        yield return(WaitUntil(
                         () => logouted,
                         () => { throw new TimeoutException(""); }
                         ));


        var loggedIn = Autoya.Auth_IsAuthenticated();

        True(!loggedIn, "state does not match.");
        yield break;
    }
    public IEnumerator HandleLogoutThenAuthenticationAttemptSucceeded()
    {
        var logouted = false;

        Autoya.Auth_Logout(() => { logouted = true; }, reason => { });
        yield return(WaitUntil(
                         () => logouted,
                         () => { throw new TimeoutException(""); }
                         ));


        Autoya.Auth_AttemptAuthenticationIfNeed();

        yield return(WaitUntil(
                         () => Autoya.Auth_IsAuthenticated(),
                         () => { throw new TimeoutException("failed to auth"); }
                         ));
    }