Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public void GetNullAttributeFromNewFile()
        {
            using (File.Create(path));
            string key    = "test";
            var    reader = new ExtendedAttributeReaderUnix();

            Assert.That(reader.GetExtendedAttribute(path, key), Is.Null);
        }
Ejemplo n.º 3
0
        public void GetNullAttributeFromNewFolder()
        {
            Directory.CreateDirectory(path);
            string key    = "test";
            var    reader = new ExtendedAttributeReaderUnix();

            Assert.That(reader.GetExtendedAttribute(path, key), Is.Null);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        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));
        }
Ejemplo n.º 7
0
        public void GetExtendedAttributeOnNonExistingFileThrowsFileNotFoundException()
        {
            string key    = "test";
            var    reader = new ExtendedAttributeReaderUnix();

            try{
                reader.GetExtendedAttribute(path, key);
            } catch (FileNotFoundException) {
                return;
            }
            Assert.Fail("FileNotFoundException not thrown");
        }
Ejemplo n.º 8
0
        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));
        }