1

以下のシナリオでテストを書く必要があります

- 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?
4

1 に答える 1

0

Java を使用している場合は、MongoDB ドキュメントが Java オブジェクトと一致することを確認してから、JAXB を使用して XML に変換できます。

于 2012-11-27T14:33:39.763 に答える