Exemple #1
0
        protected void ReturnsCorrectFontInternal(string selector)
        {
            var expectedFont = Font;
            var font         = FontRegistry.LocateFont(selector);

            Assert.Equal(expectedFont.Alias, font.Alias);
            Assert.Equal(expectedFont.FontFileName, font.FontFileName);
            Assert.Equal(expectedFont.GetGlyph(selector), font.GetGlyph(selector));
        }
Exemple #2
0
        protected void MapsToGlyphInternal(string mapping, string expectedGlyph)
        {
            var font  = FontRegistry.LocateFont(mapping);
            var glyph = font.GetGlyph(mapping);

            Assert.Equal(expectedGlyph, glyph);

            var parts = mapping.Split(' ');

            Assert.Equal(2, parts.Length);

            var glyph2 = font.GetGlyph(parts[1]);

            Assert.Equal(glyph, glyph2);
        }
        public void LookupFromRegistry(string selector, string expectedGlyph, string fontAlias)
        {
            lock (lockobject)
            {
                FontRegistry.Clear();
                FontRegistry.RegisterFonts(SampleFontAwesomeRegular.Font, SampleFontAwesomeSolid.Font);

                var font = FontRegistry.LocateFont(selector);

                Assert.NotNull(font);

                Assert.Equal(fontAlias, font.Alias);

                var locatedGlyph = font.GetGlyph(selector);

                Assert.False(string.IsNullOrWhiteSpace(locatedGlyph));
                Assert.Equal(expectedGlyph, locatedGlyph);
            }
        }