Exemplo n.º 1
0
    [MSetup] public void Setup()
    {
        Autoya.ResetAllForceSetting();

        DeleteAllData(AuthSettings.AUTH_STORED_FRAMEWORK_DOMAIN);

        var    authorized   = false;
        Action onMainThread = () => {
            var dataPath = Application.persistentDataPath;
            Autoya.TestEntryPoint(dataPath);

            Autoya.Auth_SetOnAuthenticated(
                () => {
                authorized = true;
            }
                );
        };

        RunOnMainThread(onMainThread);

        WaitUntil(
            () => {
            return(authorized);
        },
            5,
            "timeout in setup."
            );

        Assert(Autoya.Auth_IsAuthenticated(), "not logged in.");

        Autoya.forceMaintenance = true;
    }
Exemplo n.º 2
0
    public IEnumerator Setup()
    {
        Autoya.ResetAllForceSetting();

        DeleteAllData(AuthSettings.AUTH_STORED_FRAMEWORK_DOMAIN);

        var authorized = false;

        var dataPath = Application.persistentDataPath;

        Autoya.TestEntryPoint(dataPath);

        Autoya.Auth_SetOnAuthenticated(
            () =>
        {
            authorized = true;
        }
            );

        yield return(WaitUntil(
                         () =>
        {
            return authorized;
        },
                         () => { throw new TimeoutException("timeout in setup."); }
                         ));

        True(Autoya.Auth_IsAuthenticated(), "not logged in.");

        Autoya.forceMaintenance = true;
    }
 public IEnumerator Teardown()
 {
     Autoya.ResetAllForceSetting();
     Autoya.Shutdown();
     while (GameObject.Find("AutoyaMainthreadDispatcher") != null)
     {
         yield return(null);
     }
 }
    public IEnumerator Setup()
    {
        Autoya.ResetAllForceSetting();

        var dataPath = Application.persistentDataPath;
        var fwPath   = Path.Combine(dataPath, AuthSettings.AUTH_STORED_FRAMEWORK_DOMAIN);

        DeleteAllData(fwPath);

        Autoya.TestEntryPoint(dataPath);

        while (!Autoya.Auth_IsAuthenticated())
        {
            yield return(false);
        }

        var authenticated = false;

        Autoya.Auth_SetOnAuthenticated(
            () =>
        {
            authenticated = true;
        }
            );
        Autoya.Auth_SetOnBootAuthFailed(
            (code, reason) =>
        {
            Debug.LogError("code:" + code + " reason:" + reason);
        }
            );

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

        True(Autoya.Auth_IsAuthenticated(), "not logged in.");
    }
Exemplo n.º 5
0
 [MTeardown] public void Teardown()
 {
     Autoya.ResetAllForceSetting();
 }
 [MTeardown] public void Teardown()
 {
     RunOnMainThread(Autoya.Shutdown);
     Autoya.ResetAllForceSetting();
 }