예제 #1
0
        public void Should_not_return_font_family()
        {
            DISetup.SetupContainer();
            var fontManager = new Mock <ILocalizationManager>();

            DISetup.Container.RegisterInstance(fontManager.Object);
            var converter = new FontFamilyConverter();
            var result    = converter.Convert(null, null, null, null);

            result.Should().BeNull();
        }
예제 #2
0
        public void Should_return_font_family()
        {
            DISetup.SetupContainer();
            var fontManager = new Mock <IFontFamilyManager>();
            var family      = new NotoSansFontFamily();

            fontManager.Setup(s => s.ResolveFontFamily(It.Is <string>(s => s == "test"))).Returns(family);
            DISetup.Container.RegisterInstance(fontManager.Object);
            var converter = new FontFamilyConverter();
            var result    = converter.Convert("test", null, null, null);

            result.Should().Be(family.GetFontFamily());
        }
        public void Should_return_supported_name_block_font_family()
        {
            DISetup.SetupContainer();
            var fontManager     = new Mock <IFontFamilyManager>();
            var languageService = new Mock <ILanguagesService>();
            var family          = new NotoSansSCFontFamily();

            fontManager.Setup(s => s.ResolveFontFamily(It.Is <string>(s => s == "test"))).Returns(family);
            languageService.Setup(p => p.GetLanguageBySupportedNameBlock(It.IsAny <string>())).Returns(new Language()
            {
                Abrv = "en",
                Font = "test"
            });
            DISetup.Container.RegisterInstance(fontManager.Object);
            var converter = new FontFamilyConverter();
            var result    = converter.Convert("test", null, null, null);

            result.Should().Be(family.GetFontFamily());
        }