Beispiel #1
0
            public IEnumerator GetWalletByCurrencyCode_CurrencyEmpty_Success()
            {
                Wallet wallet = AccelBytePlugin.GetWallet();
                Result <WalletInfo> getWalletInfoResult = null;

                wallet.GetWalletInfoByCurrencyCode("", result => { getWalletInfoResult = result; });

                while (getWalletInfoResult == null)
                {
                    Thread.Sleep(100);

                    yield return(null);
                }

                TestHelper.Assert.IsTrue(getWalletInfoResult.IsError, "Get wallet with empty currency failed.");
            }
Beispiel #2
0
            public IEnumerator GetWalletByCurrencyCode_CurrencyInvalid_Success()
            {
                Wallet              wallet = AccelBytePlugin.GetWallet();
                const string        invalidCurrencyCode = "INVALID";
                Result <WalletInfo> getWalletInfoResult = null;

                wallet.GetWalletInfoByCurrencyCode(invalidCurrencyCode, result => { getWalletInfoResult = result; });

                while (getWalletInfoResult == null)
                {
                    Thread.Sleep(100);

                    yield return(null);
                }

                TestHelper.Assert.IsTrue(getWalletInfoResult.IsError, "Get wallet with invalid currency failed.");
            }
Beispiel #3
0
            public IEnumerator GetWalletByCurrencyCode_CurrencyValid_Success()
            {
                Wallet wallet = AccelBytePlugin.GetWallet();
                Result <WalletInfo> getWalletInfoResult = null;

                wallet.GetWalletInfoByCurrencyCode(
                    TestVariables.currencyCode,
                    result => { getWalletInfoResult = result; });

                while (getWalletInfoResult == null)
                {
                    Thread.Sleep(100);

                    yield return(null);
                }

                TestHelper.Assert.IsTrue(!getWalletInfoResult.IsError, "Get wallet failed.");
                TestHelper.Assert.IsTrue(getWalletInfoResult.Value.balance > 0, "Wallet balance isn't correct.");

                walletBalance = getWalletInfoResult.Value.balance;
            }