Skip to content

Commit

Permalink
Merge branch 'master' into saugautam/build
Browse files Browse the repository at this point in the history
  • Loading branch information
SaurabhMSFT authored Oct 16, 2024
2 parents 98cf815 + bf77c78 commit 5a1cd5e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/Microsoft.Identity.Web.Test/CacheEncryptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ private byte[] GetFirstCacheValue(MemoryCache memoryCache)
.GetType()
.GetField("_coherentState", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)!
.GetValue(memoryCache)!;
memoryCacheContent = (content1?
.GetType()
.GetProperty("EntriesCollection", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)
Type? content1Type = content1?.GetType();
// The internals of CoherentState seem to change between .NET 9 RCs
memoryCacheContent = ((
content1Type?.GetProperty("_entries", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) ??
content1Type?.GetProperty("_stringEntries", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)
)
.GetValue(content1) as IDictionary)!;
#else
memoryCacheContent = (memoryCache
Expand Down

0 comments on commit 5a1cd5e

Please sign in to comment.