public void AddToCacheReturnsGuid() { FileBasedSessionCache cache = new FileBasedSessionCache(); cache.StoreLocation = cacheLocation; string sessionToken = cache.AddToCache("johndoe"); string userName = cache.RetrieveFromCache(sessionToken); Guid sessionGuid = new Guid(sessionToken); Assert.AreEqual("johndoe", userName); }
public void RemoveFromCacheRemovesSession() { FileBasedSessionCache cache = new FileBasedSessionCache(); cache.StoreLocation = cacheLocation; string sessionToken = cache.AddToCache("johndoe"); cache.RemoveFromCache(sessionToken); string userName = cache.RetrieveFromCache(sessionToken); Assert.IsNull(userName); }