我有IEnumerable<XElement> theTestCaseNodes
以下类型的 XElements
<testcase>
<Main>
<test_step type ="action">
<Name>Goto</Name>
<description>xxxxxxxxx</description>
</test_step>
<test_step type ="check">
<Name>Click</Name>
<description>xxxxxxxxx</description>
</test_step>
</Main>
</testcase>
<testcase>
<Main>
<test_step type ="action">
<Name>Goto</Name>
<description>xxxxxxxxx</description>
</test_step>
<test_step type ="check">
<Name>Type</Name>
<description>xxxxxxxxx</description>
</test_step>
</Main>
</testcase>
基本上这是我的测试用例,我想按顺序执行它们。所以,现在我想使用 XMLReader 读取 IEnumerable 中的每个节点。
请帮助如何进行!
我知道我需要使用“使用”,但不知道如何继续。
public void ExecuteTestcase(IEnumerable<XElement> theTestCaseNodes)
{
using (XmlReader aNodeReader = XmlReader.ReadSubtree()) {
}
}