Extended attribute reader for Windows.
Inheritance: IExtendedAttributeReader
 public void GetNullAttributeFromNewFile()
 {
     using (File.Create(path));
     string key = "test";
     var reader = new ExtendedAttributeReaderDos();
     Assert.That(reader.GetExtendedAttribute(path, key) == null);
 }
 public void SetAttributeToFile()
 {
     using (File.Create(path));
     string key = "test";
     string value = "value";
     var reader = new ExtendedAttributeReaderDos();
     reader.SetExtendedAttribute(path, key, value);
     Assert.That(reader.GetExtendedAttribute(path, key).Equals(value));
 }
 public void SetUp()
 {
     var config = ITUtils.GetConfig();
     string localPath = config[1].ToString();
     this.path = Path.Combine(localPath, Path.GetRandomFileName());
     var reader = new ExtendedAttributeReaderDos();
     if (!reader.IsFeatureAvailable(localPath)) {
         Assert.Ignore("Extended Attribute not available on this machine");
     }
 }
 public void RemoveExtendedAttributeOnNonExistingFileThrowsIOException()
 {
     string key = "test";
     var reader = new ExtendedAttributeReaderDos();
     Assert.Throws<FileNotFoundException>(() => reader.RemoveExtendedAttribute(path, key));
 }
 public void CheckAvailableOnPath()
 {
     var reader = new ExtendedAttributeReaderDos();
     reader.IsFeatureAvailable(Environment.CurrentDirectory);
 }
 public void RemoveExtendedAttributeOfFileByPassingNull()
 {
     using (File.Create(path));
     string key = "test";
     var reader = new ExtendedAttributeReaderDos();
     reader.SetExtendedAttribute(path, key, null);
     Assert.That(reader.GetExtendedAttribute(path, key), Is.Null);
     Assert.That(reader.ListAttributeKeys(path).Count == 0);
 }
 public void ListAttributesOfFolder()
 {
     Directory.CreateDirectory(path);
     string key = "test";
     string value = "value";
     var reader = new ExtendedAttributeReaderDos();
     Assert.That(reader.ListAttributeKeys(path).Count == 0);
     reader.SetExtendedAttribute(path, key, value);
     Assert.That(reader.ListAttributeKeys(path).Count == 1);
     Assert.Contains("test", reader.ListAttributeKeys(path));
 }
 public void RemoveAttributeFromFolder()
 {
     Directory.CreateDirectory(path);
     string key = "test";
     string value = "value";
     var reader = new ExtendedAttributeReaderDos();
     reader.SetExtendedAttribute(path, key, value);
     Assert.That(reader.GetExtendedAttribute(path, key).Equals(value));
     reader.RemoveExtendedAttribute(path, key);
     Assert.That(reader.GetExtendedAttribute(path, key) == null);
 }
 public void OverwriteAttributeOnFolder()
 {
     Directory.CreateDirectory(path);
     string key = "test";
     string value = "value";
     string value2 = "value2";
     var reader = new ExtendedAttributeReaderDos();
     reader.SetExtendedAttribute(path, key, value);
     reader.SetExtendedAttribute(path, key, value2);
     Assert.That(reader.GetExtendedAttribute(path, key).Equals(value2));
 }
 public void GetNullAttributeFromNewFolderIfTrailingSlashesAreAvailable()
 {
     Directory.CreateDirectory(path);
     string key = "test";
     var reader = new ExtendedAttributeReaderDos();
     Assert.That(reader.GetExtendedAttribute(path.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar, key) == null);
 }
 public void GetNullAttributeFromNewFolder()
 {
     Directory.CreateDirectory(path);
     string key = "test";
     var reader = new ExtendedAttributeReaderDos();
     Assert.That(reader.GetExtendedAttribute(path, key) == null);
 }