07.11.2014 Views

Enterprise Library Test Guide - Willy .Net

Enterprise Library Test Guide - Willy .Net

Enterprise Library Test Guide - Willy .Net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Test</strong>ing the <strong>Enterprise</strong> <strong>Library</strong> Core 81<br />

<strong>Test</strong> case Result Automated test<br />

The following is the information in the configuration file.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

The following is the test case.<br />

[<strong>Test</strong>Method]<br />

public void CustomExceptionHandler<strong>Test</strong>()<br />

{<br />

string expectedException = "";<br />

try<br />

{<br />

ExceptionPolicy.HandleException(new<br />

SecurityException("To test custom handler"), "Custom<br />

Handler");<br />

}<br />

catch(Exception ex)<br />

{<br />

expectedException = ex.Message;<br />

}<br />

Assert.AreEqual(expectedException, "To test custom<br />

handler");<br />

}<br />

continued

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!