예제 #1
0
            public IEnumerator GetUserEntitlementById_Failed()
            {
                Entitlement entitlements = AccelBytePlugin.GetEntitlements();

                Result <EntitlementInfo> entitlementInfo = null;

                entitlements.GetUserEntitlementById("Invalid", result => { entitlementInfo = result; });

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

                    yield return(null);
                }

                TestHelper.Assert.IsTrue(entitlementInfo.IsError, "Get user entitlement by invalid id is success.");
            }
예제 #2
0
            public IEnumerator GetUserEntitlementById_Success()
            {
                Entitlement entitlements = AccelBytePlugin.GetEntitlements();

                Result <EntitlementInfo> entitlementInfo = null;

                entitlements.GetUserEntitlementById(expectedEntitlementId, result => { entitlementInfo = result; });

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

                    yield return(null);
                }

                TestHelper.Assert.IsTrue(!entitlementInfo.IsError, "Get user entitlement by id failed.");
                TestHelper.Assert.IsTrue(entitlementInfo.Value.id == expectedEntitlementId, "Expected entitlement is not found.");
            }