[Adapdev-commits] Adapdev/src/Adapdev.Cache.Tests AbstractICacheTest.cs,1.6,1.7 CacheManagerTest.cs,
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2006-01-26 05:10:16
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7199/src/Adapdev.Cache.Tests Modified Files: AbstractICacheTest.cs CacheManagerTest.cs FileCacheTest.cs Log Message: Index: FileCacheTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests/FileCacheTest.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileCacheTest.cs 16 Nov 2005 07:01:46 -0000 1.5 --- FileCacheTest.cs 26 Jan 2006 05:10:05 -0000 1.6 *************** *** 35,38 **** --- 35,44 ---- } + + [Test] + public void CacheCountReset() + { + Assert.AreEqual(0, this.cache.Count, "Cache was not reset"); + } } } Index: AbstractICacheTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests/AbstractICacheTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractICacheTest.cs 16 Nov 2005 07:01:46 -0000 1.6 --- AbstractICacheTest.cs 26 Jan 2006 05:10:05 -0000 1.7 *************** *** 37,41 **** cache.Add(12, e); ! Assert.IsTrue(cache.Count == 1, "Cache count should be 1."); } --- 37,41 ---- cache.Add(12, e); ! Assert.AreEqual(1, cache.Count, "Cache count should be 1."); } *************** *** 156,171 **** public virtual void Copy() { ! ICache source = this.GetCache(); this.cache.Add(1, new SuppliersEntity()); source.Add(2, new SuppliersEntity()); ! ! Assert.AreEqual(1, this.cache.Count); ! Assert.AreEqual(1, source.Count); this.cache.Copy(source); ! Assert.AreEqual(2, this.cache.Count); } --- 156,173 ---- public virtual void Copy() { ! ICache source = new MutableInMemoryCache(); this.cache.Add(1, new SuppliersEntity()); + Assert.AreEqual(1, this.cache.Count, "Target should have 1 item."); source.Add(2, new SuppliersEntity()); ! Assert.AreEqual(1, source.Count, "Source should have 1 item."); this.cache.Copy(source); ! Assert.AreEqual(2, this.cache.Count, "Combined cache count should be 2."); ! ! this.cache.Clear(); ! source.Clear(); } Index: CacheManagerTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests/CacheManagerTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CacheManagerTest.cs 16 Nov 2005 07:01:46 -0000 1.6 --- CacheManagerTest.cs 26 Jan 2006 05:10:05 -0000 1.7 *************** *** 24,27 **** --- 24,28 ---- Assert.AreEqual(0, CacheManager.Cache.Count, "Cache has switched, so count should be 0."); + CacheManager.Cache = new ImmutableInMemoryCache(); } |