コード例 #1
0
        public void GetDirectoryContents()
        {
            var provider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, Namespace + ".Resources");

            var files = provider.GetDirectoryContents("");
            Assert.NotNull(files);
            Assert.Equal(2, files.Count());
            Assert.False(provider.GetDirectoryContents("file").Exists);
            Assert.False(provider.GetDirectoryContents("file/").Exists);
            Assert.False(provider.GetDirectoryContents("file.txt").Exists);
            Assert.False(provider.GetDirectoryContents("file/txt").Exists);
        }
コード例 #2
0
        public void GetDirectoryContents()
        {
            var provider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, Namespace + ".Resources");

            var files = provider.GetDirectoryContents("");

            Assert.NotNull(files);
            Assert.Equal(2, files.Count());
            Assert.False(provider.GetDirectoryContents("file").Exists);
            Assert.False(provider.GetDirectoryContents("file/").Exists);
            Assert.False(provider.GetDirectoryContents("file.txt").Exists);
            Assert.False(provider.GetDirectoryContents("file/txt").Exists);
        }
コード例 #3
0
        protected override IEnumerable <ISnippet> CreateItems(IServiceProvider factory)
        {
            var hostEnvironment = factory.GetRequiredService <IHostEnvironment>();

            var embeddedSnippets = new List <ISnippet>(base.CreateItems(factory));
            var snippetProvider  = new EmbeddedFileProvider(typeof(IAssemblyProvider).Assembly, "Umbraco.Cms.Core.EmbeddedResources.Snippets");
            var embeddedFiles    = snippetProvider.GetDirectoryContents(string.Empty)
                                   .Where(x => !x.IsDirectory && x.Name.EndsWith(".cshtml"));

            foreach (var file in embeddedFiles)
            {
                using var stream = new StreamReader(file.CreateReadStream());
                embeddedSnippets.Add(new Snippet(file.Name, stream.ReadToEnd().Trim()));
            }

            var customSnippetsDir = new DirectoryInfo(hostEnvironment.MapPathContentRoot($"{Constants.SystemDirectories.Umbraco}/PartialViewMacros/Templates"));

            if (!customSnippetsDir.Exists)
            {
                return(embeddedSnippets);
            }

            var customSnippets = customSnippetsDir.GetFiles().Select(f => new Snippet(f.Name, File.ReadAllText(f.FullName)));
            var allSnippets    = Merge(embeddedSnippets, customSnippets);

            return(allSnippets);
        }
コード例 #4
0
        protected override IEnumerable <ISnippet> CreateItems(IServiceProvider factory)
        {
            var embeddedSnippets = new List <ISnippet>(base.CreateItems(factory));

            // Ignore these
            var filterNames = new List <string>
            {
                "Gallery",
                "ListChildPagesFromChangeableSource",
                "ListChildPagesOrderedByProperty",
                "ListImagesFromMediaFolder"
            };

            var snippetProvider = new EmbeddedFileProvider(typeof(IAssemblyProvider).Assembly, "Umbraco.Cms.Core.EmbeddedResources.Snippets");
            var embeddedFiles   = snippetProvider.GetDirectoryContents(string.Empty)
                                  .Where(x => !x.IsDirectory && x.Name.EndsWith(".cshtml"));

            foreach (var file in embeddedFiles)
            {
                if (!filterNames.Contains(Path.GetFileNameWithoutExtension(file.Name)))
                {
                    using var stream = new StreamReader(file.CreateReadStream());
                    embeddedSnippets.Add(new Snippet(file.Name, stream.ReadToEnd().Trim()));
                }
            }

            return(embeddedSnippets);
        }
コード例 #5
0
        public IDirectoryContents GetDirectoryContents(string subpath)
        {
            if (subpath == null)
            {
                return(new NotFoundDirectoryContents());
            }

            var resourcePath = subpath.Replace("-", "_")
                               .Replace("~/", "")
                               .Replace("/", ".")
                               .Replace("\\", ".")
                               .Trim(new char[] { '.' });

            var allFiles = _embeddedFileProvider
                           .GetDirectoryContents(string.Empty)
                           .Where(f => f.Name.StartsWith(resourcePath, StringComparison.OrdinalIgnoreCase))
            ;

            if (!allFiles.Any())
            {
                return(new NotFoundDirectoryContents());
            }

            var directoryContents = new EmbeddedDirectoryContents(resourcePath, allFiles);

            return(directoryContents);
        }
コード例 #6
0
ファイル: Configuration.cs プロジェクト: KeenMate/Blogifier
        static void LoadThemes()
        {
            /*
             * This code relies on Blogifier.Web.csproj to have this line:
             * <EmbeddedResource Include="Views\Blogifier\**\Single.cshtml" />
             * We need it to populate list of installed themes when project
             * deployed precompiled and file system not accessible
             */
            try
            {
                var assembly  = Assembly.LoadFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Blogifier.Web.dll"));
                var provider  = new EmbeddedFileProvider(assembly, assembly.GetName().Name);
                var resources = provider.GetDirectoryContents("/");

                BlogSettings.BlogThemes = new List <SelectListItem>();
                BlogSettings.BlogThemes.Add(new SelectListItem {
                    Value = "Standard", Text = "Standard"
                });

                foreach (var rsrc in resources)
                {
                    var theme = rsrc.Name.Replace("Views.Blogifier.Themes.", "").Replace(".Single.cshtml", "");
                    BlogSettings.BlogThemes.Add(new SelectListItem
                    {
                        Text  = theme,
                        Value = theme
                    });
                }
            }
            catch { }
        }
コード例 #7
0
        static void LoadThemes()
        {
            try
            {
                var assembly  = Assembly.LoadFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BlogApplication.Core.dll"));
                var provider  = new EmbeddedFileProvider(assembly, assembly.GetName().Name);
                var resources = provider.GetDirectoryContents("/");

                BlogSettings.BlogThemes = new List <SelectListItem>();
                BlogSettings.BlogThemes.Add(new SelectListItem {
                    Value = "Standard", Text = "Standard"
                });

                foreach (var rsrc in resources)
                {
                    var theme = rsrc.Name.Replace("Views.BlogFile.Themes.", "").Replace(".Single.cshtml", "");
                    BlogSettings.BlogThemes.Add(new SelectListItem
                    {
                        Text  = theme,
                        Value = theme
                    });
                }
            }
            catch { }
        }
コード例 #8
0
        public AppTextAdminInitializer(ILogger <AppTextAdminInitializer> logger, IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
            var embeddedProvider = new EmbeddedFileProvider(typeof(AppTextAdminInitializer).Assembly);

            _translationsContents = embeddedProvider.GetDirectoryContents("");
            _logger = logger;
        }
コード例 #9
0
        public void GetDirectoryContents_ReturnsAllFilesInFileSystem(string path)
        {
            // Arrange
            var provider = new EmbeddedFileProvider(GetType().Assembly, Namespace + ".Resources");

            // Act
            var files = provider.GetDirectoryContents(path);

            // Assert
            Assert.Collection(files.OrderBy(f => f.Name, StringComparer.Ordinal),
                              file => Assert.Equal("File.txt", file.Name),
                              file => Assert.Equal("ResourcesInSubdirectory.File3.txt", file.Name));

            Assert.False(provider.GetDirectoryContents("file").Exists);
            Assert.False(provider.GetDirectoryContents("file/").Exists);
            Assert.False(provider.GetDirectoryContents("file.txt").Exists);
            Assert.False(provider.GetDirectoryContents("file/txt").Exists);
        }
コード例 #10
0
        public void GetDirInfo_with_no_matching_base_namespace()
        {
            var provider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "Unknown.Namespace");

            var files = provider.GetDirectoryContents(string.Empty);
            Assert.NotNull(files);
            Assert.True(files.Exists);
            Assert.Equal(0, files.Count());
        }
コード例 #11
0
        public void GetDirInfo_with_no_matching_base_namespace()
        {
            var provider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "Unknown.Namespace");

            var files = provider.GetDirectoryContents(string.Empty);

            Assert.NotNull(files);
            Assert.True(files.Exists);
            Assert.Equal(0, files.Count());
        }
コード例 #12
0
ファイル: Resources.cs プロジェクト: EYHN/Anything
    public static IEnumerable <string> GetAllEmbeddedFile(Assembly assembly, string rootPath = "/")
    {
        var embeddedFileProvider = new EmbeddedFileProvider(assembly);
        var directoryContents    = embeddedFileProvider.GetDirectoryContents("/");

        rootPath = rootPath.TrimStart('/').Replace('/', '.').Replace('\\', '.');
        return(directoryContents
               .Where(content => content.Name.StartsWith(rootPath, StringComparison.Ordinal))
               .Select(content => content.Name));
    }
コード例 #13
0
    private string GetPartialViewMacroSnippetContent(string snippetName, PartialViewType partialViewType)
    {
        if (snippetName.IsNullOrWhiteSpace())
        {
            throw new ArgumentNullException(nameof(snippetName));
        }

        string partialViewHeader;

        switch (partialViewType)
        {
        case PartialViewType.PartialView:
            partialViewHeader = PartialViewHeader;
            break;

        case PartialViewType.PartialViewMacro:
            partialViewHeader = PartialViewMacroHeader;
            break;

        default:
            throw new ArgumentOutOfRangeException(nameof(partialViewType));
        }

        var snippetProvider =
            new EmbeddedFileProvider(GetType().Assembly, "Umbraco.Cms.Core.EmbeddedResources.Snippets");

        IFileInfo?file = snippetProvider.GetDirectoryContents(string.Empty)
                         .FirstOrDefault(x => x.Exists && x.Name.Equals(snippetName + ".cshtml"));

        // Try and get the snippet path
        if (file is null)
        {
            throw new InvalidOperationException("Could not load snippet with name " + snippetName);
        }

        using (var snippetFile = new StreamReader(file.CreateReadStream()))
        {
            var snippetContent = snippetFile.ReadToEnd().Trim();

            // strip the @inherits if it's there
            snippetContent = StripPartialViewHeader(snippetContent);

            // Update Model.Content to be Model when used as PartialView
            if (partialViewType == PartialViewType.PartialView)
            {
                snippetContent = snippetContent
                                 .Replace("Model.Content.", "Model.")
                                 .Replace("(Model.Content)", "(Model)");
            }

            var content = $"{partialViewHeader}{Environment.NewLine}{snippetContent}";
            return(content);
        }
    }
コード例 #14
0
        public static IEnumerable <IFileInfo> GetResources(this Assembly assembly, string name, bool ignoreCase = false)
        {
            List <IFileInfo> files = new List <IFileInfo>();
            var embedded           = new EmbeddedFileProvider(assembly);
            var resources          = embedded.GetDirectoryContents("/").Where(x => x.Name.Contains(name, ignoreCase));

            foreach (var resource in resources)
            {
                files.Add(resource);
            }
            return(files);
        }
コード例 #15
0
        public static IEnumerable <IFileInfo> GetResources(this Assembly assembly)
        {
            List <IFileInfo> files = new List <IFileInfo>();
            var embedded           = new EmbeddedFileProvider(assembly);
            var resources          = embedded.GetDirectoryContents("/");

            foreach (var resource in resources)
            {
                files.Add(resource);
            }
            return(files);
        }
コード例 #16
0
        public static IEnumerable <Stream> GetResourcesAsStream(this Assembly assembly, Regex regex)
        {
            List <Stream> files     = new List <Stream>();
            var           embedded  = new EmbeddedFileProvider(assembly);
            var           resources = embedded.GetDirectoryContents("/").Where(x => regex.IsMatch(x.Name));

            foreach (var resource in resources)
            {
                files.Add(resource.CreateReadStream());
            }
            return(files);
        }
コード例 #17
0
        public void GetDirectoryContents_ReturnsEmptySequence_IfResourcesDoNotExistUnderNamespace()
        {
            // Arrange
            var provider = new EmbeddedFileProvider(GetType().Assembly, "Unknown.Namespace");

            // Act
            var files = provider.GetDirectoryContents(string.Empty);

            // Assert
            Assert.NotNull(files);
            Assert.True(files.Exists);
            Assert.Empty(files);
        }
コード例 #18
0
        public static IEnumerable <string> GetResourcesAsString(this Assembly assembly)
        {
            List <string> files     = new List <string>();
            var           embedded  = new EmbeddedFileProvider(assembly);
            var           resources = embedded.GetDirectoryContents("/");

            foreach (var resource in resources)
            {
                var resourceName = $"{Assembly.GetExecutingAssembly().GetName().Name}.{resource.Name}";
                files.Add(assembly.GetResourceAsString(resourceName));
            }
            return(files);
        }
コード例 #19
0
        public void GetDirectoryContents_ReturnsNotFoundDirectoryContents_IfHierarchicalPathIsSpecified(string path)
        {
            // Arrange
            var provider = new EmbeddedFileProvider(GetType().Assembly);

            // Act
            var files = provider.GetDirectoryContents(path);

            // Assert
            Assert.NotNull(files);
            Assert.False(files.Exists);
            Assert.Empty(files);
        }
コード例 #20
0
        /// <summary>
        /// Gets a directory listing from the embedded files in the Hood assembly.
        /// WARNING, this should only be used for loading files in known definite locations. as the
        /// file provider uses a flat structure, sub-directories will be returned along with the files.
        /// </summary>
        /// <param name="basePath">The base path in the form ~/path/of/the/file.extension</param>
        /// <returns></returns>
        public static string[] GetFiles(string basePath)
        {
            basePath = ReWritePath(basePath);
            EmbeddedFileProvider provider = GetProvider(Engine.Services.Resolve <IConfiguration>());

            if (provider == null)
            {
                return(new List <string>().ToArray());
            }
            IDirectoryContents contents = provider.GetDirectoryContents("");

            System.Collections.Generic.IEnumerable <IFileInfo> dir = contents.Where(p => p.Name.StartsWith(basePath));
            return(dir.Select(f => f.Name.Replace(basePath, "")).ToArray());
        }
コード例 #21
0
        public static IEnumerable <Stream> GetResourcesAsStream(this IEnumerable <Assembly> assemblies)
        {
            List <Stream> files = new List <Stream>();

            foreach (var assembly in assemblies)
            {
                var embedded  = new EmbeddedFileProvider(assembly);
                var resources = embedded.GetDirectoryContents("/");
                foreach (var resource in resources)
                {
                    files.Add(resource.CreateReadStream());
                }
            }
            return(files);
        }
コード例 #22
0
        public static IEnumerable <IFileInfo> GetResources(this IEnumerable <Assembly> assemblies, Regex regex)
        {
            List <IFileInfo> files = new List <IFileInfo>();

            foreach (var assembly in assemblies)
            {
                var embedded  = new EmbeddedFileProvider(assembly);
                var resources = embedded.GetDirectoryContents("/").Where(x => regex.IsMatch(x.Name));
                foreach (var resource in resources)
                {
                    files.Add(resource);
                }
            }
            return(files);
        }
コード例 #23
0
        public static IEnumerable <Stream> GetResourcesAsStream(this IEnumerable <Assembly> assemblies, string name, bool ignoreCase = false)
        {
            List <Stream> files = new List <Stream>();

            foreach (var assembly in assemblies)
            {
                var embedded  = new EmbeddedFileProvider(assembly);
                var resources = embedded.GetDirectoryContents("/").Where(x => x.Name.Contains(name, ignoreCase));
                foreach (var resource in resources)
                {
                    files.Add(resource.CreateReadStream());
                }
            }
            return(files);
        }
コード例 #24
0
        public static IEnumerable <Stream> GetResourcesAsStream(this Assembly assembly, string[] names, bool ignoreCase = false)
        {
            var           rs       = new List <IFileInfo>();
            List <Stream> files    = new List <Stream>();
            var           embedded = new EmbeddedFileProvider(assembly);

            foreach (var name in names)
            {
                var resources = embedded.GetDirectoryContents("/").Where(x => x.Name.Contains(name, ignoreCase));
                rs.AddRange(resources);
            }
            foreach (var resource in rs)
            {
                files.Add(resource.CreateReadStream());
            }
            return(files);
        }
コード例 #25
0
ファイル: Test04.cs プロジェクト: wwwK/Ray.EssayNotes.DDD
        public override void Run()
        {
            IFileProvider fileProvider = new EmbeddedFileProvider(Assembly.GetExecutingAssembly());

            //目录
            IDirectoryContents contents = fileProvider.GetDirectoryContents("/");

            foreach (var item in contents)
            {
                Stream stream = item.CreateReadStream();
                Console.WriteLine(item.Name);
            }

            //文件
            IFileInfo fileInfo = fileProvider.GetFileInfo("emb.html");

            Console.WriteLine(fileInfo.AsFormatJsonStr());
        }
コード例 #26
0
        public IEnumerable <string> GetPartialViewSnippetNames(params string[] filterNames)
        {
            var snippetProvider =
                new EmbeddedFileProvider(this.GetType().Assembly, "Umbraco.Cms.Core.EmbeddedResources.Snippets");

            var files = snippetProvider.GetDirectoryContents(string.Empty)
                        .Where(x => !x.IsDirectory && x.Name.EndsWith(".cshtml"))
                        .Select(x => Path.GetFileNameWithoutExtension(x.Name))
                        .Except(filterNames, StringComparer.InvariantCultureIgnoreCase)
                        .ToArray();

            //Ensure the ones that are called 'Empty' are at the top
            var empty = files.Where(x => Path.GetFileName(x)?.InvariantStartsWith("Empty") ?? false)
                        .OrderBy(x => x?.Length)
                        .ToArray();

            return(empty.Union(files.Except(empty)).WhereNotNull());
        }
コード例 #27
0
        static void AddFileProviders(IServiceCollection services)
        {
            try
            {
                //  services.Configure<MvcRazorRuntimeCompilationOptions>(
                services.AddControllersWithViews().AddRazorRuntimeCompilation(options =>
                {
                    foreach (var assembly in AppConfig.GetAssemblies(true))
                    {
                        var fileProvider = new EmbeddedFileProvider(assembly, assembly.GetName().Name);

                        // load themes from embedded provider
                        var content = fileProvider.GetDirectoryContents("");
                        if (content.Exists)
                        {
                            foreach (var item in content)
                            {
                                if (item.Name.StartsWith("Views.Themes"))
                                {
                                    if (AppConfig.EmbeddedThemes == null)
                                    {
                                        AppConfig.EmbeddedThemes = new List <string>();
                                    }

                                    var ar = item.Name.Split('.');
                                    if (ar.Length > 2 && !AppConfig.EmbeddedThemes.Contains(ar[2]))
                                    {
                                        if (assembly.GetName().Name.ToLower() != "app")
                                        {
                                            AppConfig.EmbeddedThemes.Add(ar[2]);
                                        }
                                    }
                                }
                            }
                        }

                        options.FileProviders.Add(fileProvider);
                    }
                });
            }
            catch { }
        }
コード例 #28
0
    public void Can_Load_Language_Xml_Files()
    {
        var readFilesCount = 0;
        var xmlDocument    = new XmlDocument();

        var languageProvider = new EmbeddedFileProvider(typeof(IAssemblyProvider).Assembly, "Umbraco.Cms.Core.EmbeddedResources.Lang");
        var files            = languageProvider.GetDirectoryContents(string.Empty)
                               .Where(x => !x.IsDirectory && x.Name.EndsWith(".xml"));

        foreach (var languageFile in files)
        {
            using var stream = new StreamReader(languageFile.CreateReadStream());

            // Load will throw an exception if the XML isn't valid.
            xmlDocument.Load(stream);
            readFilesCount++;
        }

        // Ensure that at least one file was read.
        Assert.AreNotEqual(0, readFilesCount);
    }
コード例 #29
0
        public IDirectoryContents GetDirectoryContents(string subpath)
        {
            if (subpath == null)
            {
                return(new NotFoundDirectoryContents());
            }

            var resourcePath = EmbeddedResourcePathFormatter.ConvertFromVirtualDirectory(subpath);

            var allFiles = _embeddedFileProvider
                           .GetDirectoryContents(string.Empty)
                           .Where(f => f.Name.StartsWith(resourcePath, StringComparison.OrdinalIgnoreCase))
            ;

            if (!allFiles.Any())
            {
                return(new NotFoundDirectoryContents());
            }

            var directoryContents = new EmbeddedDirectoryContents(resourcePath, allFiles);

            return(directoryContents);
        }
コード例 #30
0
        private void CopyFolderFromStream(string dest, Type type)
        {
            var fileProvider = new EmbeddedFileProvider(Assembly.GetAssembly(type));
            var res          = fileProvider.GetDirectoryContents("").ToList();

            foreach (IFileInfo file in res)
            {
                var    path     = file.Name.Split(".").SkipLast(2).ToList();
                var    fileName = file.Name.Replace(string.Join(".", path), "").TrimStart('.');
                string destName = Path.Combine(dest);
                path.ForEach(fp =>
                {
                    if (fp != DefaultRazorTemplate)
                    {
                        destName = Path.Combine(destName, fp);
                    }
                });
                var dirPath = destName;
                destName = Path.Combine(destName, fileName);
                if (!file.IsDirectory)
                {
                    if (!File.Exists(destName))
                    {
                        if (!Directory.Exists(dirPath))
                        {
                            Directory.CreateDirectory(dirPath);
                        }
                        var fileString = new StreamReader(file.CreateReadStream()).ReadToEnd();
                        File.WriteAllText(destName, fileString, Encoding.UTF8);
                    }
                }
                else
                {
                    Directory.CreateDirectory(destName);
                }
            }
        }
コード例 #31
0
        public async Task <IActionResult> Get(string lang, string part, long?timestamp)
        {
            var tempLang             = lang.Replace("-", "_");
            var embeddedFileProvider = new EmbeddedFileProvider(Assembly.GetEntryAssembly());
            var contents             = embeddedFileProvider.GetDirectoryContents("");
            var fileInfo             = contents.FirstOrDefault(
                f => f.Name.Equals($"Translations.{tempLang}.{part}.json", StringComparison.InvariantCultureIgnoreCase));

            if (fileInfo != null)
            {
                if (fileInfo.LastModified.Ticks > timestamp.GetValueOrDefault())
                {
                    using (var reader = new StreamReader(fileInfo.CreateReadStream()))
                    {
                        var trad = await reader.ReadToEndAsync();

                        trad = trad.Insert(1, "\"Part\" : \"" + part + "\",");
                        object temp = JsonConvert.DeserializeObject(trad);
                        return(this.Ok(new
                        {
                            TimeStamp = fileInfo.LastModified.Ticks,
                            Translation = temp,
                            Lang = lang,
                        }));
                    }
                }
                else
                {
                    return(this.StatusCode(304));
                }
            }
            else
            {
                return(this.NotFound());
            }
        }
コード例 #32
0
 public IDirectoryContents GetDirectoryContents(string subpath) => _inner.GetDirectoryContents(subpath);
コード例 #33
0
        public void GetDirectoryContents_ReturnsAllFilesInFileSystem(string path)
        {
            // Arrange
            var provider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, Namespace + ".Resources");

            // Act
            var files = provider.GetDirectoryContents(path);

            // Assert
            Assert.Collection(files.OrderBy(f => f.Name, StringComparer.Ordinal),
                file => Assert.Equal("File.txt", file.Name),
                file => Assert.Equal("ResourcesInSubdirectory.File3.txt", file.Name));

            Assert.False(provider.GetDirectoryContents("file").Exists);
            Assert.False(provider.GetDirectoryContents("file/").Exists);
            Assert.False(provider.GetDirectoryContents("file.txt").Exists);
            Assert.False(provider.GetDirectoryContents("file/txt").Exists);
        }
コード例 #34
0
        public void GetDirectoryContents_ReturnsEmptySequence_IfResourcesDoNotExistUnderNamespace()
        {
            // Arrange
            var provider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, "Unknown.Namespace");

            // Act
            var files = provider.GetDirectoryContents(string.Empty);

            // Assert
            Assert.NotNull(files);
            Assert.True(files.Exists);
            Assert.Empty(files);
        }
コード例 #35
0
        public void GetDirectoryContents_ReturnsNotFoundDirectoryContents_IfHierarchicalPathIsSpecified(string path)
        {
            // Arrange
            var provider = new EmbeddedFileProvider(GetType().GetTypeInfo().Assembly, Namespace);

            // Act
            var files = provider.GetDirectoryContents(path);

            // Assert
            Assert.NotNull(files);
            Assert.False(files.Exists);
            Assert.Empty(files);
        }