Skip to content

Commit

Permalink
Fix test failing du to change in reference of Microsoft.Extensions.Ca…
Browse files Browse the repository at this point in the history
…che.Memory to 6.x (because of obsolete version 5,x)
  • Loading branch information
jmprieur committed Dec 16, 2024
1 parent 3cdec89 commit 64ab29d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Microsoft.Identity.Web.Test/CacheEncryptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task EncryptionTestAsync(bool isEncrypted)
private byte[] GetFirstCacheValue(MemoryCache memoryCache)
{
IDictionary memoryCacheContent;
# if NET6_0
# if NET6_0 || NET462
memoryCacheContent = (memoryCache
.GetType()
.GetProperty("StringKeyEntriesCollection", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!
Expand Down Expand Up @@ -88,7 +88,7 @@ private byte[] GetFirstCacheValue(MemoryCache memoryCache)
.GetType()
.GetField("_entries", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!
.GetValue(_testCacheAdapter!._memoryCache) as IDictionary)!;
#endif
#endif // NET472
var firstEntry = memoryCacheContent.Values.OfType<object>().First();
var firstEntryValue = firstEntry.GetType()
.GetProperty("Value")!
Expand Down

0 comments on commit 64ab29d

Please sign in to comment.