Exemple #1
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_selected_language_block_font_family()
        {
            DISetup.SetupContainer();
            var fontManager     = new Mock <IFontFamilyManager>();
            var languageService = new Mock <ILanguagesService>();
            var family          = new NotoSansFontFamily();

            fontManager.Setup(s => s.ResolveFontFamily(It.Is <string>(s => s == "test"))).Returns(family);
            languageService.Setup(p => p.GetLanguageBySupportedNameBlock(It.IsAny <string>())).Returns((ILanguage)null);
            languageService.Setup(p => p.GetSelected()).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());
        }