public void TestSerializeMsalAccountCacheItem() { var item = CreateAccountItem(); string asJson = item.ToJsonString(); var item2 = MsalAccountCacheItem.FromJsonString(asJson); AssertAccountCacheItemsAreEqual(item, item2); }
public void TestSerializeAccountWithWamId() { MsalAccountCacheItem item = CreateAccountItem(); item.WamAccountIds = new Dictionary <string, string>() { { "client_id_1", "wam_id_1" }, { "client_id_2", "wam_id_2" } }; string asJson = item.ToJsonString(); Assert.IsTrue(asJson.Contains(@" ""wam_account_ids"": { ""client_id_1"": ""wam_id_1"", ""client_id_2"": ""wam_id_2"" }")); var item2 = MsalAccountCacheItem.FromJsonString(asJson); AssertAccountCacheItemsAreEqual(item, item2); }
public MsalAccountCacheItem GetAccount(MsalAccountCacheKey accountKey) { return(MsalAccountCacheItem.FromJsonString(_accountSharedPreference.GetString(accountKey.ToString(), null))); }
public void TestMsalAccountCacheItemFromJsonStringEmpty() { var item = MsalAccountCacheItem.FromJsonString(null); Assert.IsNull(item); }
public List <MsalAccountCacheItem> GetAllAccounts(string optionalPartitionKey = null, ICoreLogger requestlogger = null) { return(_accountSharedPreference.All.Values.Cast <string>().Select(x => MsalAccountCacheItem.FromJsonString(x)).ToList()); }
public MsalAccountCacheItem GetAccount(MsalAccountCacheKey accountKey) { return(MsalAccountCacheItem.FromJsonString(GetPayload(accountKey))); }
public IEnumerable <MsalAccountCacheItem> GetAllAccounts() { return(GetPayloadAsString(MsalCacheKeys.iOSAuthorityTypeToAttrType[CacheAuthorityType.MSSTS.ToString()]) .Select(x => MsalAccountCacheItem.FromJsonString(x)) .ToList()); }
public IReadOnlyList <MsalAccountCacheItem> GetAllAccounts() { return(_accountSharedPreference.All.Values.Cast <string>().Select(x => MsalAccountCacheItem.FromJsonString(x)).ToList()); }
public List <MsalAccountCacheItem> GetAllAccounts(string optionalPartitionKey = null, ICoreLogger requestlogger = null) { return(GetPayloadAsString(MsalCacheKeys.iOSAuthorityTypeToAttrType[CacheAuthorityType.MSSTS.ToString()]) .Select(x => MsalAccountCacheItem.FromJsonString(x)) .ToList()); }