public void GetAccount_Test() { var accessor = new InMemoryPartitionedUserTokenCacheAccessor(new NullLogger(), null); var acc1 = TokenCacheHelper.CreateAccountItem("tenant1", "homeAccountId"); var acc2 = TokenCacheHelper.CreateAccountItem("tenant1", "homeAccountId2"); var acc3 = TokenCacheHelper.CreateAccountItem("tenant2", "homeAccountId"); // Assert: Null non-existing item Assert.IsNull(accessor.GetAccount(acc1.GetKey())); accessor.SaveAccount(acc1); accessor.SaveAccount(acc2); accessor.SaveAccount(acc3); // Assert: Get token by key Assert.AreEqual(acc2.GetKey(), accessor.GetAccount(acc2.GetKey()).GetKey()); Assert.AreEqual(acc3.GetKey(), accessor.GetAccount(acc3.GetKey()).GetKey()); }