[Adapdev-commits] Adapdev/src/Adapdev.Cache.Tests CacheManagerTest.cs,1.1,1.2
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2005-11-02 13:45:26
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7036/src/Adapdev.Cache.Tests Modified Files: CacheManagerTest.cs Log Message: Improved ObjectComparer to include field comparisons Added AssociationType for ForeignKeyAssociations Improved CacheManager and associated tests Index: CacheManagerTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests/CacheManagerTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CacheManagerTest.cs 25 May 2005 05:17:46 -0000 1.1 --- CacheManagerTest.cs 2 Nov 2005 13:45:12 -0000 1.2 *************** *** 25,28 **** --- 25,44 ---- } + + [Test] + public void SetCache() + { + Assert.AreEqual(typeof(ImmutableInMemoryCache), CacheManager.Cache.GetType()); + + CacheManager.Cache.Add(1, new SuppliersEntity()); + Assert.AreEqual(1, CacheManager.Cache.Count); + + CacheManager.SetCache(CacheType.MutableInMemory); + Assert.AreEqual(1, CacheManager.Cache.Count, "Cache has switched BUT should have been copied, so count should be 1."); + + CacheManager.SetCache(CacheType.ImmutableInMemory, false); + Assert.AreEqual(0, CacheManager.Cache.Count, "Cache has switched BUT should not have been copied, so count should be 0."); + + } } } |