Esempio n. 1
0
 public void IfExistsRecycle()
 {
     var xml = new XmlSample(@"<Move Destination='somewhere' IfExists='recycle' />");
     using (var reader = xml.Read())
     {
         var rule = ConfigFileReader.ReadRule(reader, false) as MoveRule;
         Assert.AreEqual(MoveRule.IfExistsMode.Recycle, rule.IfExists);
     }
 }
Esempio n. 2
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);
     }
 }
Esempio n. 3
0
 public void ValidElement()
 {
     var xml = new XmlSample(@"<Empty />");
     using( var reader = xml.Read() )
     {
         var filter = ConfigFileReader.ReadFilter(reader);
         Assert.IsInstanceOf<EmptyFilter>(filter);
     }
 }
Esempio n. 4
0
 public void AttributeMissing()
 {
     var xml = new XmlSample(@"<Move />");
     using (var reader = xml.Read())
     {
         Assert.Throws<AttributeMissingException>(() =>
         {
             ConfigFileReader.ReadRule(reader, false);
         });
     }
 }
 public void AttributeMissing()
 {
     var xml = new XmlSample(@"<BiggerThan />");
     using (var reader = xml.Read())
     {
         Assert.Throws<AttributeMissingException>(() =>
         {
             ConfigFileReader.ReadFilter(reader);
         });
     }
 }
        public void Mega()
        {
            var xml = new XmlSample(@"<BiggerThan MB='10' />");
            using (var reader = xml.Read())
            {
                var filter = ConfigFileReader.ReadFilter(reader);
                Assert.IsInstanceOf<BiggerThanFilter>(filter);

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