public IEnumerator ServerGetUserEntitlementById_Failed() { ServerEcommerce serverEcommerce = AccelByteServerPlugin.GetEcommerce(); Result <EntitlementInfo> entitlementInfo = null; serverEcommerce.GetUserEntitlementById("Invalid", result => { entitlementInfo = result; }); while (entitlementInfo == null) { Thread.Sleep(100); yield return(null); } TestHelper.Assert.IsTrue(entitlementInfo.IsError, "Server get user entitlement by invalid id is success."); }
public IEnumerator ServerGetUserEntitlementById_Success() { ServerEcommerce serverEcommerce = AccelByteServerPlugin.GetEcommerce(); Result <EntitlementInfo> entitlementInfo = null; serverEcommerce.GetUserEntitlementById(expectedEntitlementId, result => { entitlementInfo = result; }); while (entitlementInfo == null) { Thread.Sleep(100); yield return(null); } TestHelper.Assert.IsTrue(!entitlementInfo.IsError, "Server get user entitlement by id failed."); TestHelper.Assert.IsTrue(entitlementInfo.Value.id == expectedEntitlementId, "Expected entitlement is not found."); }