Ejemplo n.º 1
0
        public void ICompressedArchiveAccess_ListWithNullArchive_ThrowsArgumentNullException()
        {
            ICompressedArchiveAccess archive = null;

            Assert.Throws <ArgumentNullException>(() => archive.ListEntries(null, includeContainers: false));
            Assert.Throws <ArgumentNullException>(() => archive.ListContents(null, includeContainers: false));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// List the contents of the given compressed archive.
 /// </summary>
 /// <param name="compressedArchiveAccess">An instance of <see cref="ICompressedArchiveAccess"/> whose contents are to be listed.</param>
 /// <param name="locationInArchive">A location relative to the root of the archive. The special values <c>null</c>, <c>string.Empty</c>, '\', '/', or '.' indicate the root. Otherwise, must end with a directory separator character.</param>
 /// <param name="includeContainers">If <c>true</c>, include entries that may contain other entries, such as other compressed archives and directories.</param>
 /// <returns>The list of entries, which may include entries that could contain more items, depending on the value of <paramref name="includeContainers"/>.</returns>
 /// <remarks>NOTE: Entry names are always relative to <paramref name="compressedArchiveAccess"/>. Path separators will be normalized to forward slash.</remarks>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="compressedArchiveAccess"/> is <c>null</c>.</exception>
 /// <exception cref="ArgumentException">Thrown if <paramref name="locationInArchive"/> is malformed i.e. is not null or empty, or does not end with a directory separator character.</exception>
 /// <exception cref="FileNotFoundException">Thrown if <paramref name="locationInArchive"/> identifies a nested archive that cannot be located.</exception>
 public static IEnumerable <string> ListContents(this ICompressedArchiveAccess compressedArchiveAccess, string locationInArchive, bool includeContainers)
 {
     return(compressedArchiveAccess.ListContents(locationInArchive, includeContainers, recurse: false));
 }