public void OverwriteAttributeOnFile()
        {
            using (File.Create(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 SetExtendedAttributeOnNonExistingFileThrowsIOException()
        {
            string key    = "test";
            var    reader = new ExtendedAttributeReaderDos();

            Assert.Throws <FileNotFoundException>(() => reader.SetExtendedAttribute(path, key, null));
        }
        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 SetAttributeToFolder()
        {
            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));
        }
        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 RemoveAttributeFromFile()
        {
            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));
            reader.RemoveExtendedAttribute(path, key);
            Assert.That(reader.GetExtendedAttribute(path, key) == null);
        }