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 Logging Application Block 95<br />

To learn how the test teams tested the application blocks to see if they conformed<br />

to security best practices, see <strong>Test</strong>ing for Security Best Practices. To learn how the test<br />

teams tested the application blocks to see if they conformed to globalization best<br />

practices, see <strong>Test</strong>ing for Globalization Best Practices. To learn how the test teams tested<br />

the application blocks to see if they met the performance and scalability requirements,<br />

see <strong>Test</strong>ing for Performance and Scalability.<br />

Using Automated <strong>Test</strong>s<br />

Automated tests ensure that the application block functions in accordance with its<br />

requirements. Automated tests make regression testing easier and certain tests, such<br />

as simulating a large number of uses to test a multithreading scenario, require automation.<br />

Table 5: Visual Studio Team System <strong>Test</strong>s for the Logging Application Block<br />

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

Verify that the<br />

application block<br />

throws the appropriate<br />

exception when it<br />

Passed The following test uses an invalid log entry.<br />

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

[ExpectedException(typeof(ArgumentNullException)<br />

)]<br />

receives invalid data.<br />

public void LogNullValueLogEntryMessage()<br />

{<br />

Logger.Write(new LogEntry(null, "", -1, -1,<br />

System.Diagnostics.TraceEventType.Critical, "",<br />

null));<br />

}<br />

continued

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

Saved successfully!

Ooh no, something went wrong!