public void DeleteIdToken_Test() { var accessor = new InMemoryPartitionedUserTokenCacheAccessor(new NullLogger(), null); var idt1 = TokenCacheHelper.CreateIdTokenCacheItem("tenant1", "homeAccountId"); var idt2 = TokenCacheHelper.CreateIdTokenCacheItem("tenant1", "homeAccountId2"); var idt3 = TokenCacheHelper.CreateIdTokenCacheItem("tenant2", "homeAccountId"); // Assert: Delete on empty collection doesn't throw accessor.DeleteIdToken(idt1); accessor.SaveIdToken(idt1); accessor.SaveIdToken(idt2); accessor.SaveIdToken(idt3); Assert.AreEqual(3, accessor.GetAllIdTokens().Count); // Assert: Delete on existing item accessor.DeleteIdToken(idt1); Assert.AreEqual(2, accessor.GetAllIdTokens().Count); }