Page 1 of 1

Mark test suite as failed if condition in user code fails?

Posted: Mon Aug 05, 2013 2:23 pm
by kmck
I currently have a C# user code module that checks a document and creates a report if certain errors exist within the document. I was able to provide an error report for that particular user code, but the test suite still shows as passed.

How can I append my code to get the test suite to show as failed?

Thanks!

Re: Mark test suite as failed if condition in user code fails?

Posted: Mon Aug 05, 2013 2:36 pm
by krstcs
Have you tried...

Code: Select all

Report.Error(...);
Report.Log(ReportLevel.Error, ...);

Report.Failure(...);
Report.Log(ReportLevel.Failure, ...);

Re: Mark test suite as failed if condition in user code fails?

Posted: Mon Aug 05, 2013 3:13 pm
by kmck
Report.Failure worked perfectly. Thanks! :lol:

Re: Mark test suite as failed if condition in user code fails?

Posted: Mon Aug 05, 2013 3:29 pm
by krstcs
You're welcome!

Note that "Report.Error(...)" and "Report.Log(ReportLevel.Error, ...)" do the same thing. "Report.Error()" and all of the other methods like it (Info(), Pass(), etc.) are helpers for "Report.Log(ReportLevel.XXX, ...)".

Using "Report.Log()" allows you to pass a variable that will set the level.