public void RetreiveProfileNotInCache() { ISecurityCacheProvider securityCache = SecurityCacheFactory.GetSecurityCacheProvider(); Assert.IsNotNull(securityCache); IToken token = new GuidToken() as IToken; Assert.IsNotNull(token); object cachedProfile = securityCache.GetProfile(token); Assert.IsNull(cachedProfile); }
public void RetreiveCachedProfile() { ISecurityCacheProvider securityCache = SecurityCacheFactory.GetSecurityCacheProvider(defaultInstance); Assert.IsNotNull(securityCache); IToken token = securityCache.SaveProfile(profile); Assert.IsNotNull(token); Assert.IsNotNull(token.Value); object cachedProfile = securityCache.GetProfile(token); Assert.IsNotNull(cachedProfile); Assert.AreEqual(cachedProfile.ToString(), "testprofile"); }
public void ExplicitlyExpireProfile() { ISecurityCacheProvider securityCache = SecurityCacheFactory.GetSecurityCacheProvider(defaultInstance); Assert.IsNotNull(securityCache); IToken token = securityCache.SaveProfile(profile); Assert.IsNotNull(token); Assert.IsNotNull(token.Value); securityCache.ExpireProfile(token); object tmpProfile = securityCache.GetProfile(token); Assert.IsNull(tmpProfile); }
public void SaveProfileWithTokenFromPreviouslyCachedItem() { ISecurityCacheProvider securityCache = SecurityCacheFactory.GetSecurityCacheProvider(defaultInstance); Assert.IsNotNull(securityCache); IIdentity identity = new GenericIdentity("zman", "testauthtype"); IToken token = securityCache.SaveIdentity(identity); Assert.IsNotNull(token); securityCache.SaveProfile(profile, token); Assert.IsNotNull(token); Assert.IsNotNull(token.Value); object tmpProfile = securityCache.GetProfile(token); Assert.IsNotNull(tmpProfile); Assert.AreEqual(tmpProfile.ToString(), "testprofile"); }