Reputation: 5162
Let's say I have an XElement
object, which represents Xml like
<modification name="givenName" operation="add" xmlns="urn:oasis:names:tc:DSML:2:0:core">
<value>Changed name</value>
<child id="abc">Some dummy value</child>
</modification>
How can I test The <value>
element's value is "Changed name", and <child>
element has attribute id
"abc", and value "Some dummy value"?
Upvotes: 0
Views: 309
Reputation: 8889
element.Should().HaveElement("value").Which.Should().HaveValue("Changed name");
element.Should().HaveElement("child").Which.Should().HaveAttribute("id", "abc").And.HaveValue("Some dummy value");
Upvotes: 1