lundi 28 septembre 2015

Omit XLWorkbook save file when UnitTest

I have pretty big class which generates excel report. Now I am adding unitTest to it, but it takes pretty long time.

I could decrease time needed for that test if I could omit saving the file inside the report. Its done this way:

instance:

var workbook = new XLWorkbook(path);

saving

Monitor.Enter(SyncRoot);
workbook.SaveAs(outputPath);
Monitor.Exit(SyncRoot);

I am using Unity as IoC, is that possible to inject instance of workbook and setup SaveAs Method to return true immediately ? If not what would you recommend?

Aucun commentaire:

Enregistrer un commentaire