我需要在以下场景中编写测试
- I have a ruby script to read xml data and store the resultant data in MongoDB.
- I want to write a test, which compares the xml and the imported content in the db and make sure the data in xml and imported data are similar.
请考虑以下示例 xml 文件:
<employees>
<employee>
<name>xxx</name>
</employee>
<employee>
<name>yyy</name>
</employee>
</employees>
employees (table)
-----------------
name
xxx
yyy
how do i write test for this case?
如果你使用的是Java,你可以确保你的MongoDB文档与你的Java对象匹配,然后使用JAXB转换为XML。