Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        public void RemoveExtendedAttributeOnNonExistingFileThrowsFileNotFoundException()
        {
            string key    = "test";
            var    reader = new ExtendedAttributeReaderUnix();

            try{
                reader.RemoveExtendedAttribute(path, key);
            } catch (FileNotFoundException) {
                return;
            }
            Assert.Fail("FileNotFoundException not thrown");
        }
Example #4
0
        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);
        }