[Test] public void AssertXPathExistsFailsForNonExistentXPath() { try { XmlAssert.XPathExists("//star[@name='alpha centauri']", MY_SOLAR_SYSTEM); Assert.Fail("Expected assertion failure"); } catch (AssertionException e) { AvoidUnusedVariableCompilerWarning(e); } }
[Test] public void AssertXPathExistsWorksForExistentXPath() { XmlAssert.XPathExists("//planet[@name='Earth']", MY_SOLAR_SYSTEM); }