Exemplo n.º 1
0
            public IEnumerator ConsumeUserEntitlementZero_Failed()
            {
                Entitlement entitlements = AccelBytePlugin.GetEntitlements();

                Result <EntitlementInfo> getEntitlementInfoResult = null;

                entitlements.ConsumeUserEntitlement(expectedEntitlementId, 0, result => { getEntitlementInfoResult = result; });

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

                    yield return(null);
                }

                TestHelper.Assert.IsTrue(getEntitlementInfoResult.IsError, "Consume user entitlement success.");
            }
Exemplo n.º 2
0
            public IEnumerator ConsumeUserEntitlement_Success()
            {
                Entitlement entitlements = AccelBytePlugin.GetEntitlements();

                Result <EntitlementInfo> getEntitlementInfoResult = null;

                entitlements.ConsumeUserEntitlement(expectedEntitlementId, 1, result => { getEntitlementInfoResult = result; });

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

                    yield return(null);
                }

                bool bConsumeUserEntitlement = (getEntitlementInfoResult.Value.status == EntitlementStatus.CONSUMED);

                TestHelper.Assert.IsTrue(!getEntitlementInfoResult.IsError, "Consume user entitlement failed.");
                TestHelper.Assert.IsTrue(bConsumeUserEntitlement, "Consume user entitlement failed.");
            }