public GetExtendedAttribute ( string path, string key ) : string | ||
path | string | Path to the file or folder. |
key | string | Key of the extended attribute. |
리턴 | string |
public void GetNullAttributeFromNewFile() { using (File.Create(path)); string key = "test"; var reader = new ExtendedAttributeReaderUnix(); Assert.That(reader.GetExtendedAttribute(path, key), Is.Null); }
public void SetAttributeToFile() { using (File.Create(path)); string key = "test"; string value = "value"; var reader = new ExtendedAttributeReaderUnix(); reader.SetExtendedAttribute(path, key, value); Assert.That(reader.GetExtendedAttribute(path, key).Equals(value)); }
public void GetExtendedAttributeOnNonExistingFileThrowsFileNotFoundException() { string key = "test"; var reader = new ExtendedAttributeReaderUnix(); try{ reader.GetExtendedAttribute(path, key); } catch (FileNotFoundException) { return; } Assert.Fail("FileNotFoundException not thrown"); }
public void RemoveNonExistingAttributeFromFolder() { Directory.CreateDirectory(path); string key = "test"; var reader = new ExtendedAttributeReaderUnix(); reader.RemoveExtendedAttribute(path, key); Assert.That(reader.GetExtendedAttribute(path, key), Is.Null); }
public void RemoveNonExistingAttributeFromFile() { using (File.Create(path)); string key = "test"; var reader = new ExtendedAttributeReaderUnix(); reader.RemoveExtendedAttribute(path, key); Assert.That(reader.GetExtendedAttribute(path, key), Is.Null); }
public void RemoveAttributeFromFolder() { Directory.CreateDirectory(path); string key = "test"; string value = "value"; var reader = new ExtendedAttributeReaderUnix(); reader.SetExtendedAttribute(path, key, value); Assert.That(reader.GetExtendedAttribute(path, key).Equals(value)); reader.RemoveExtendedAttribute(path, key); Assert.That(reader.GetExtendedAttribute(path, key), Is.Null); }
public void OverwriteAttributeOnFolder() { Directory.CreateDirectory(path); string key = "test"; string value = "value"; string value2 = "value2"; var reader = new ExtendedAttributeReaderUnix(); reader.SetExtendedAttribute(path, key, value); reader.SetExtendedAttribute(path, key, value2); Assert.That(reader.GetExtendedAttribute(path, key).Equals(value2)); }
public void GetNullAttributeFromNewFolder() { Directory.CreateDirectory(path); string key = "test"; var reader = new ExtendedAttributeReaderUnix(); Assert.That(reader.GetExtendedAttribute(path, key), Is.Null); }