public void Assert_IsUnique_fails_because_the_searched_item_exists_several_times() { var xml = GetTextResource("MbUnit.Tests.Framework.SolarSystem.xml"); AssertionFailure[] failures = Capture(() => Assert.Xml.IsUnique(xml, XmlPath.Element("SolarSystem").Element("Planets").Element("Planet"), XmlOptions.Default)); Assert.Count(1, failures); Assert.AreEqual("Expected the XML fragment to contain only once the searched XML element or attribute, But several were found.", failures[0].Description); Assert.AreEqual("/SolarSystem/Planets/Planet", failures[0].LabeledValues[0].FormattedValue.ToString()); Assert.AreEqual("8", failures[0].LabeledValues[1].FormattedValue.ToString()); }
public void Assert_Exists_with_null_xml_should_throw_exception() { Assert.Xml.Exists((string)null, XmlPath.Element("Root"), XmlOptions.Default); }
public void Assert_Exists_with_null_reader_should_throw_exception() { Assert.Xml.Exists((TextReader)null, XmlPath.Element("Root"), XmlOptions.Default); }
public void Assert_IsUnique_passes() { var xml = GetTextResource("MbUnit.Tests.Framework.SolarSystem.xml"); Assert.Xml.IsUnique(xml, XmlPath.Element("SolarSystem").Element("Planets"), XmlOptions.Default); }