Exemplo n.º 1
0
        public void Clear_Test()
        {
            var database = Database.OpenFile(_dbFileName);
            var dateTime = DateTime.Now;

            database.Cache.Insert(new CacheItem()
            {
                Domain       = "d",
                Hash         = Convert.ToBase64String(Guid.NewGuid().ToByteArray()),
                LastAccessed = dateTime,
                LastUpdated  = dateTime,
                Size         = 50
            });

            database.Cache.Insert(new CacheItem()
            {
                Domain       = "d",
                Hash         = Convert.ToBase64String(Guid.NewGuid().ToByteArray()),
                LastAccessed = dateTime.AddDays(-1),
                LastUpdated  = dateTime.AddDays(-1),
                Size         = 100
            });

            _store.Clear();
            var list = _store.GetDomainSizes();

            Assert.AreEqual(0, list.Count);
        }