public virtual void SimpleImageCacheTest02()
        {
            String[] imgSrc = new String[] { "src0.jpg", "src1.jpg", "src2.jpg", "src3.jpg", "src4.jpg", "src5.jpg" };
            SimpleImageCacheTest.ImageXObjectStub[] imgData = new SimpleImageCacheTest.ImageXObjectStub[] { new SimpleImageCacheTest.ImageXObjectStub
                                                                                                                (), new SimpleImageCacheTest.ImageXObjectStub(), new SimpleImageCacheTest.ImageXObjectStub(), new SimpleImageCacheTest.ImageXObjectStub
                                                                                                                (), new SimpleImageCacheTest.ImageXObjectStub(), new SimpleImageCacheTest.ImageXObjectStub() };
            SimpleImageCache cache = new SimpleImageCache(4);

            // imgs frequency is increased on getImage call
            cache.GetImage(imgSrc[1]);
            cache.GetImage(imgSrc[2]);
            cache.PutImage(imgSrc[0], imgData[0]);
            cache.PutImage(imgSrc[1], imgData[1]);
            cache.PutImage(imgSrc[2], imgData[2]);
            NUnit.Framework.Assert.AreEqual(3, cache.Size());
            cache.GetImage(imgSrc[0]);
            cache.GetImage(imgSrc[1]);
            cache.GetImage(imgSrc[2]);
            cache.PutImage(imgSrc[3], imgData[3]);
            NUnit.Framework.Assert.AreEqual(4, cache.Size());
            cache.PutImage(imgSrc[4], imgData[4]);
            NUnit.Framework.Assert.AreEqual(4, cache.Size());
            NUnit.Framework.Assert.IsNull(cache.GetImage(imgSrc[3]));
            NUnit.Framework.Assert.AreEqual(imgData[0], cache.GetImage(imgSrc[0]));
            NUnit.Framework.Assert.AreEqual(imgData[1], cache.GetImage(imgSrc[1]));
            NUnit.Framework.Assert.AreEqual(imgData[2], cache.GetImage(imgSrc[2]));
            NUnit.Framework.Assert.AreEqual(imgData[4], cache.GetImage(imgSrc[4]));
            cache.GetImage(imgSrc[0]);
            cache.GetImage(imgSrc[1]);
            cache.GetImage(imgSrc[2]);
            cache.GetImage(imgSrc[4]);
            cache.PutImage(imgSrc[5], imgData[5]);
            NUnit.Framework.Assert.AreEqual(4, cache.Size());
            NUnit.Framework.Assert.IsNull(cache.GetImage(imgSrc[4]));
            NUnit.Framework.Assert.AreEqual(imgData[0], cache.GetImage(imgSrc[0]));
            NUnit.Framework.Assert.AreEqual(imgData[1], cache.GetImage(imgSrc[1]));
            NUnit.Framework.Assert.AreEqual(imgData[2], cache.GetImage(imgSrc[2]));
            NUnit.Framework.Assert.AreEqual(imgData[5], cache.GetImage(imgSrc[5]));
            cache.PutImage(imgSrc[3], imgData[3]);
            NUnit.Framework.Assert.AreEqual(4, cache.Size());
            NUnit.Framework.Assert.AreEqual(imgData[3], cache.GetImage(imgSrc[3]));
            NUnit.Framework.Assert.IsNull(cache.GetImage(imgSrc[5]));
            cache.PutImage(imgSrc[5], imgData[5]);
            NUnit.Framework.Assert.AreEqual(4, cache.Size());
            NUnit.Framework.Assert.AreEqual(imgData[5], cache.GetImage(imgSrc[5]));
            NUnit.Framework.Assert.IsNull(cache.GetImage(imgSrc[3]));
            cache.PutImage(imgSrc[3], imgData[3]);
            NUnit.Framework.Assert.AreEqual(4, cache.Size());
            NUnit.Framework.Assert.AreEqual(imgData[3], cache.GetImage(imgSrc[3]));
            NUnit.Framework.Assert.IsNull(cache.GetImage(imgSrc[5]));
            cache.PutImage(imgSrc[5], imgData[5]);
            NUnit.Framework.Assert.AreEqual(4, cache.Size());
            NUnit.Framework.Assert.AreEqual(imgData[5], cache.GetImage(imgSrc[5]));
            NUnit.Framework.Assert.AreEqual(imgData[3], cache.GetImage(imgSrc[3]));
            NUnit.Framework.Assert.AreEqual(imgData[1], cache.GetImage(imgSrc[1]));
            NUnit.Framework.Assert.AreEqual(imgData[2], cache.GetImage(imgSrc[2]));
            NUnit.Framework.Assert.IsNull(cache.GetImage(imgSrc[0]));
            NUnit.Framework.Assert.IsNull(cache.GetImage(imgSrc[4]));
        }
        public virtual void SimpleImageCacheTest01()
        {
            SimpleImageCache cache  = new SimpleImageCache();
            String           imgSrc = "src1.jpg";

            SimpleImageCacheTest.ImageXObjectStub imageData = new SimpleImageCacheTest.ImageXObjectStub();
            NUnit.Framework.Assert.AreEqual(0, cache.Size());
            cache.PutImage(imgSrc, imageData);
            NUnit.Framework.Assert.AreEqual(1, cache.Size());
            NUnit.Framework.Assert.AreEqual(imageData, cache.GetImage(imgSrc));
        }