Compare the number of attachments in two documents:
<testcase name="haveSameNumberOfEmbeddedFiles"> <assertThat testDocument="test/test.pdf" masterDocument="master/master.pdf" > <haveSameNumberOfEmbeddedFiles /> </assertThat> </testcase>
To compare the attachments by name or by content you can use the tag
<haveSameEmbeddedFiles />:
<testcase name="haveSameEmbeddedFiles"> <assertThat testDocument="test/test.pdf" masterDocument="master/master.pdf" > <haveSameEmbeddedFiles comparedBy="NAME" /> <haveSameEmbeddedFiles comparedBy="CONTENT" /></assertThat> </testcase>
The attribute comparedBy=".." provides the two constants
NAME and CONTENT.
You can use the utility ExtractEmbeddedFiles to extract the attachments.
See chapter 9.4: “Extract Attachments”.