Exemple #1
0
    public void Can_search_modules_resources_folder()
    {
        var uiIndexFile = ssResources.GetFile("/modules/ui/index.html");

        Assert.That(uiIndexFile, Is.Not.Null);

        var sharedComponentFiles = ssResources.GetAllMatchingFiles("/modules/shared/*.html").ToList();

        Assert.That(sharedComponentFiles.Count, Is.GreaterThanOrEqualTo(8));

        var componentFiles = ssResources.GetAllMatchingFiles("/modules/ui/components/*.html").ToList();

        Assert.That(componentFiles.Count, Is.GreaterThanOrEqualTo(6));

        var adminUiJsFiles = ssResources.GetAllMatchingFiles("/modules/admin-ui/js/*.js").ToList();

        Assert.That(adminUiJsFiles.Count, Is.GreaterThanOrEqualTo(3));

        var adminUiCssFiles = ssResources.GetAllMatchingFiles("/modules/admin-ui/css/*.css").ToList();

        Assert.That(adminUiCssFiles.Count, Is.GreaterThanOrEqualTo(1));

        var adminUiHtmlFiles = ssResources.GetAllMatchingFiles("/modules/admin-ui/components/*.html").ToList();

        Assert.That(adminUiHtmlFiles.Count, Is.GreaterThanOrEqualTo(3));
    }
Exemple #2
0
        private void ScanPaths()
        {
            var pattern = Path.ChangeExtension("*", this.Config.RazorFileExtension);

            var files = PathProvider.GetAllMatchingFiles(pattern);

            files.Each(x => AddPage(x));
        }
Exemple #3
0
        public void ReturnAllMatchingFiles_ReturnAllFilesInProvider()
        {
            Provider.RootDirectory.CreateFile("File1.ext", "");
            Provider.RootDirectory.CreateFile("File2.ext", "");
            Provider.RootDirectory.CreateFile("File3.ext", "");
            Provider.RootDirectory.CreateDirectory("Folder1");
            Provider.RootDirectory.CreateFile("Folder1/File1.ext", "");

            var files = Provider.GetAllMatchingFiles("*.ext", int.MaxValue);

            Assert.That(files.Select(d => d.VirtualPath), Is.EquivalentTo(new[]
            {
                "/File1.ext",
                "/File2.ext",
                "/File3.ext",
                "/Folder1/File1.ext",
            }));
        }
 public IEnumerable <IVirtualFile> filesFind(IVirtualPathProvider vfs, string globPattern) => vfs.GetAllMatchingFiles(globPattern);