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); } }
public void IfExistsRecycle() { var xml = new XmlSample(@"<Rename Name='newname' IfExists='recycle' />"); using (var reader = xml.Read()) { var rule = ConfigFileReader.ReadRule(reader, false) as RenameRule; Assert.AreEqual(RenameRule.IfExistsMode.Recycle, rule.IfExists); } }
public void ValidElement() { var xml = new XmlSample(@"<Empty />"); using (var reader = xml.Read()) { var filter = ConfigFileReader.ReadFilter(reader); Assert.IsInstanceOf <EmptyFilter>(filter); } }
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); } }
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); } }
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); } }
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); } }
public void AttributeMissing() { var xml = new XmlSample(@"<Rename />"); using (var reader = xml.Read()) { Assert.Throws<AttributeMissingException>(() => { ConfigFileReader.ReadRule(reader, false); }); } }
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 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); } }
public static void Main(string[] args) { XmlSample.TestMain(); }