We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Tips for unit testing with Aspose.Cells for .NET

I have written an Excel export class for ASP.NET MVC using C#, worked very well thanks.

However, I am still getting up to speed with test drive development (TDD). I do realise I should have written the tests first.

The idea of Unite tests is just to test the code on its own, and I was wondering if anyone had any hints, and tips as to how to test code that is permeated with calls to the Aspose.Cells. Writing a wrapper for the code is one thing, but I seem to be making heavy weather of it.

Perhaps I am asking for too much, if it is mocked it can’t get to generate the Excel report at the end. I almost think that testing isn’t possible.

My code is quite simple. It loads in a template Workbook. Inserts rows of data into the first sheet, changing formatting for the header line, as well as formats for DateTime, Int, and Decimal. The Excel report is then streamed out at the end.]

There is a fair amount of logic mostly to do with styling, but I find that all the items are so enmeshed.




Well, we have no better idea how to perform accurate and complete unit testing for any component including Aspose.Cells. I am afraid, you need to write your own code segments for your logic/operations using Aspose.Cells API and you should do it.

Feel free to contact us if you find any issue.

Thank you.