public void ValidElement() { var xml = new XmlSample(@"<Empty />"); using (var reader = xml.Read()) { var filter = ConfigFileReader.ReadFilter(reader); Assert.IsInstanceOf <EmptyFilter>(filter); } }
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); } }