public virtual void ClearFontCacheTest()
        {
            String fontName = "FreeSans.ttf";

            NUnit.Framework.Assert.IsNull(FontCache.GetFont(fontName));
            FontProgram fontProgram = new FontCacheNoFontAsianTest.FontProgramMock();

            FontCache.SaveFont(fontProgram, fontName);
            NUnit.Framework.Assert.AreEqual(fontProgram, FontCache.GetFont(fontName));
            FontCache.ClearSavedFonts();
            NUnit.Framework.Assert.IsNull(FontCache.GetFont(fontName));
        }
        public virtual void FontStringTtcCacheKeyTest()
        {
            String       fontName = "Font.ttc";
            FontCacheKey ttc0     = FontCacheKey.Create(fontName, 0);
            FontCacheKey ttc1     = FontCacheKey.Create(fontName, 1);

            NUnit.Framework.Assert.IsNull(FontCache.GetFont(ttc0));
            NUnit.Framework.Assert.IsNull(FontCache.GetFont(ttc1));
            FontProgram fontProgram = new FontCacheNoFontAsianTest.FontProgramMock();

            FontCache.SaveFont(fontProgram, ttc1);
            NUnit.Framework.Assert.IsNull(FontCache.GetFont(ttc0));
            NUnit.Framework.Assert.AreEqual(fontProgram, FontCache.GetFont(ttc1));
        }
        public virtual void FontBytesTtcCacheKeyTest()
        {
            byte[]       fontBytes       = "SupposedTtcFontData".GetBytes(System.Text.Encoding.UTF8);
            byte[]       otherFontBytes  = "DifferentTtcFontBytes".GetBytes(System.Text.Encoding.UTF8);
            byte[]       normalFontBytes = "NormalFontBytes".GetBytes(System.Text.Encoding.UTF8);
            FontCacheKey ttc0            = FontCacheKey.Create(fontBytes, 1);
            FontCacheKey otherTtc0       = FontCacheKey.Create(otherFontBytes, 1);
            FontCacheKey normal          = FontCacheKey.Create(normalFontBytes);

            NUnit.Framework.Assert.IsNull(FontCache.GetFont(ttc0));
            NUnit.Framework.Assert.IsNull(FontCache.GetFont(otherTtc0));
            NUnit.Framework.Assert.IsNull(FontCache.GetFont(normal));
            FontProgram otherTtc0MockFontProgram = new FontCacheNoFontAsianTest.FontProgramMock();
            FontProgram normalMockFontProgram    = new FontCacheNoFontAsianTest.FontProgramMock();

            FontCache.SaveFont(otherTtc0MockFontProgram, otherTtc0);
            FontCache.SaveFont(normalMockFontProgram, normal);
            NUnit.Framework.Assert.IsNull(FontCache.GetFont(ttc0));
            NUnit.Framework.Assert.AreEqual(otherTtc0MockFontProgram, FontCache.GetFont(otherTtc0));
            NUnit.Framework.Assert.AreEqual(normalMockFontProgram, FontCache.GetFont(normal));
        }