Example #1
0
        public static IEnumerator VerifyEndpoint()
        {
            Debug.Log("Testing RemoteAssetBundleUtils.CheckEndpoint");
            Task <bool> task = RemoteAssetBundleUtils.CheckEndpoint(TestConstants.TEST_SERVER_ENDPOINT_CHECK);

            while (!task.IsCompleted)
            {
                yield return(null);
            }
            bool status = task.Result;

            Assert.IsTrue(status);

            // Now check JWT authentication
            Task <bool> t = RemoteAssetBundleUtils.CheckJWT(TestConstants.TEST_SERVER_ENDPOINT_CHECK, TestConstants.JWT_TOKEN_NAME);

            while (!t.IsCompleted)
            {
                yield return(null);
            }
            bool jwtStatus = t.Result;

            Assert.IsTrue(jwtStatus);
            Debug.Log("Passed");
        }
    public async void OnCheckEndpoint(string serverEndpoint)
    {
        bool status;

        if (!string.IsNullOrEmpty(serverEndpoint))
        {
            status = await RemoteAssetBundleUtils.CheckEndpoint(serverEndpoint);
        }
        else
        {
            status = false;
        }
        if (status)
        {
            GUIConfigureTab.AddMessage("Successfully Connected to Server!", MessageStatus.Success);
        }
        else
        {
            GUIConfigureTab.AddMessage("Unable to Connect to Server!", MessageStatus.Error);
        }
    }