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."); }
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."); }