public void GetAppMetadata_Test(bool isAppCache) { var accessor = CreateTokenCacheAccessor(isAppCache); var appMetadataItem = TokenCacheHelper.CreateAppMetadataItem(); accessor.SaveAppMetadata(appMetadataItem); Assert.AreEqual(appMetadataItem.GetKey(), accessor.GetAppMetadata(appMetadataItem.GetKey()).GetKey()); }
public void SaveAppMetadata_Test(bool isAppCache) { var accessor = CreateTokenCacheAccessor(isAppCache); // Assert: Same key overwrites existing item accessor.SaveAppMetadata(TokenCacheHelper.CreateAppMetadataItem()); accessor.SaveAppMetadata(TokenCacheHelper.CreateAppMetadataItem()); Assert.AreEqual(1, GetAppMetadataCache(accessor, isAppCache).Count); // Assert: Different key accessor.SaveAppMetadata(TokenCacheHelper.CreateAppMetadataItem(TestConstants.ClientId2)); Assert.AreEqual(2, GetAppMetadataCache(accessor, isAppCache).Count); }