We are using GemBox.Document library to export huge documents for construction business area (measurement protocols, invoices etc). Documents are based on a huge controller which generates data and it’s very important to permanently check that the output produced is always the same.
One of our unit tests is therefore producing documents based on some testing data and is comparing the output to the referenced documents which were generated initially.
For the comparison of documents, I’m using dirty and simple code:
if (generatedDoc.Content.ToString() != correctDocument.Content.ToString())
{
// Start visual comparison by using Microsoft.Office.Interop.Word
}
Sure, this comparison has some disadvantages. Sometimes it reports problems even there are no any data or design changes in the document. Like currently when I want to upgrade our GemBox.Document library v3.1.1134 to the latest v3.3.1187. The content has a lot of changes even output is (probably) correct.
My question is: do you anyone (GemBox support) uses similar tests to check if document content is still the same? Maybe there is already a code to compare two document models somewhere?
Regards
Lukas