Exemple #1
0
        public void FontLoader_FindCorrectPartialMatchesInFontsEmbeddedResources_FindsTheRightNumber()
        {
            var appAssembly       = Substitute.For <IApplicationAssembly>();
            var fontsAssembly     = Substitute.For <IFontsAssembly>();
            var filesystem        = Substitute.For <IFileSystem>();
            var messenger         = Substitute.For <IFrameworkMessenger>();
            var properties        = Substitute.For <IStartupPropertiesCache>();
            var subFontGenerator  = Substitute.For <ISubFontGenerator>();
            var gpuSurfaceManager = Substitute.For <IGpuSurfaceManager>();



            IFontLoader loader = new FontLoader(
                appAssembly,
                fontsAssembly,
                messenger,
                gpuSurfaceManager,
                properties,
                subFontGenerator,
                filesystem);

            fontsAssembly.GetManifestResourceNames().Returns(new List <string>
            {
                "partial.test.uniqueend0.fnt",
                "no.match.here",
                "partial.test.uniqueend1.fnt",
                "partial.test.uniqueend2.fnt",
                "no.match.here",
                "no.match.here",
                "partial.test.uniqueend3",
                "partial.test.uniqueend4.fnt",
                "no.match.here",
                "no.match.here",
            });

            appAssembly.Name.Returns("partial");

            var result = loader.FindDotFntFileNamePartialMatchesFromEmbeddedResource(true, "test");

            Assert.Equal(4, result.Count);
        }