Example #1
0
 public void IfExistsDelete()
 {
     var xml = new XmlSample(@"<Rename Name='newname' IfExists='delete' />");
     using (var reader = xml.Read())
     {
         var rule = ConfigFileReader.ReadRule(reader, false) as RenameRule;
         Assert.AreEqual(RenameRule.IfExistsMode.Delete, rule.IfExists);
     }
 }
Example #2
0
 public void DestinationAttribute()
 {
     var xml = new XmlSample(@"<Rename Name='newname' />");
     using (var reader = xml.Read())
     {
         var rule = ConfigFileReader.ReadRule(reader, false) as RenameRule ;
         Assert.AreEqual("newname", rule.Name);
     }
 }
Example #3
0
        public void ValidElement()
        {
            var xml = new XmlSample(@"<Empty />");

            using (var reader = xml.Read())
            {
                var filter = ConfigFileReader.ReadFilter(reader);
                Assert.IsInstanceOf <EmptyFilter>(filter);
            }
        }
Example #4
0
        public void DestinationAttribute()
        {
            var xml = new XmlSample(@"<Move Destination='somewhere' />");

            using (var reader = xml.Read())
            {
                var rule = ConfigFileReader.ReadRule(reader, false) as MoveRule;
                Assert.AreEqual("somewhere", rule.Destination);
            }
        }
Example #5
0
        public void IfExistsDelete()
        {
            var xml = new XmlSample(@"<Move Destination='somewhere' IfExists='delete' />");

            using (var reader = xml.Read())
            {
                var rule = ConfigFileReader.ReadRule(reader, false) as MoveRule;
                Assert.AreEqual(MoveRule.IfExistsMode.Delete, rule.IfExists);
            }
        }
Example #6
0
        public void IfExistsDelete()
        {
            var xml = new XmlSample(@"<Rename Name='newname' IfExists='delete' />");

            using (var reader = xml.Read())
            {
                var rule = ConfigFileReader.ReadRule(reader, false) as RenameRule;
                Assert.AreEqual(RenameRule.IfExistsMode.Delete, rule.IfExists);
            }
        }
Example #7
0
        public void DestinationAttribute()
        {
            var xml = new XmlSample(@"<Rename Name='newname' />");

            using (var reader = xml.Read())
            {
                var rule = ConfigFileReader.ReadRule(reader, false) as RenameRule;
                Assert.AreEqual("newname", rule.Name);
            }
        }
Example #8
0
 public void AttributeMissing()
 {
     var xml = new XmlSample(@"<Rename />");
     using (var reader = xml.Read())
     {
         Assert.Throws<AttributeMissingException>(() =>
         {
             ConfigFileReader.ReadRule(reader, false);
         });
     }
 }
Example #9
0
        public void AttributeMissing()
        {
            var xml = new XmlSample(@"<Move />");

            using (var reader = xml.Read())
            {
                Assert.Throws <AttributeMissingException>(() =>
                {
                    ConfigFileReader.ReadRule(reader, false);
                });
            }
        }
Example #10
0
        public void AttributeMissing()
        {
            var xml = new XmlSample(@"<BiggerThan />");

            using (var reader = xml.Read())
            {
                Assert.Throws <AttributeMissingException>(() =>
                {
                    ConfigFileReader.ReadFilter(reader);
                });
            }
        }
Example #11
0
        public void Tera()
        {
            var xml = new XmlSample(@"<BiggerThan TB='10' />");

            using (var reader = xml.Read())
            {
                var filter = ConfigFileReader.ReadFilter(reader);
                Assert.IsInstanceOf <BiggerThanFilter>(filter);

                var size = ((BiggerThanFilter)filter).Size;
                Assert.AreEqual(10L * 1024 * 1024 * 1024, size);
            }
        }