public virtual IArchiveEntry GetEntry(string entryName) { if (!CanRead) { throw new InvalidOperationException(Properties.ExceptionMessages.ArchiveIsWriteOnly); } entryName = SanitizeEntryName(entryName); return(GetEntries().Where(entry => PathUtilities.AreEqual(SanitizeEntryName(entry.Name), entryName)) .FirstOrDefault()); }
public void TestAreNotEqualWithUnequalPaths() { Assert.IsFalse(PathUtilities.AreEqual(@"C:\path\to\", @"C:\path\to\directory\")); }
public void TestAreEqualWithEqualPathsWithMixedCase() { Assert.IsTrue(PathUtilities.AreEqual(@"C:\path\TO\directory\", @"C:\path\to\DIRECTORY\")); }
public void TestAreEqualWithEqualPathsWithMixedDirectorySeparator() { Assert.IsTrue(PathUtilities.AreEqual(@"C:/path\to/directory\", @"C:/path/to\directory\")); }
public void TestAreEqualWithSecondPathEmpty() { Assert.IsFalse(PathUtilities.AreEqual(@"C:\path\to\directory\", string.Empty)); }
public void TestAreEqualWithFirstPathEmpty() { Assert.IsFalse(PathUtilities.AreEqual(string.Empty, @"C:\path\to\directory\")); }
public void TestAreEqualWithBothPathsEmpty() { Assert.IsTrue(PathUtilities.AreEqual(string.Empty, string.Empty)); }