Enterprise Library Test Guide - Willy .Net
Enterprise Library Test Guide - Willy .Net
Enterprise Library Test Guide - Willy .Net
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 87<br />
Priority<br />
High<br />
High<br />
High<br />
Medium<br />
High<br />
High<br />
Medium<br />
High<br />
Code test case<br />
Verify that the logging application block can log the same message to multiple categories.<br />
Verify that the application block logs messages to the trace listeners in a thread safe<br />
manner.<br />
Verify that the performance counters and the event log that are required by the application<br />
block are installed during installation.<br />
Verify that the application block requests or demands the appropriate code access<br />
security permissions to access protected resources and operations.<br />
Verify that the application block follows exception management best practices.<br />
Verify that the application block follows security best practices.<br />
Verify that the application block follows globalization best practices.<br />
Verify that the application block follows performance best practices.<br />
Verifying the <strong>Test</strong> Cases<br />
After you identify all the design test cases, you can verify that the design satisfies<br />
them. Table 3 lists how each of the design test cases were verified for the Logging<br />
Application Block.<br />
Table 3: Logging Application Block Design Verification<br />
Design test case Implemented? Feature that implements design<br />
Verify that the application<br />
block can be extended with<br />
custom trace listeners, custom<br />
formatters, and custom<br />
filters.<br />
Yes<br />
The CustomTraceListener class and the<br />
TraceListener class allow users to create<br />
custom trace listeners.<br />
The ILogFormatter interface and the LogFormatter<br />
class allow users to create custom<br />
formatters.<br />
The ILogFilter interface and the LogFilter<br />
class allow users to create custom filters.<br />
Verify that the application<br />
block uses a simple façade to<br />
log messages.<br />
Verify that there is a consistent<br />
approach to creating<br />
trace listeners, formatters,<br />
and filters.<br />
Verify that the application block<br />
can retrieve configuration data<br />
from different sources, such<br />
as an application configuration<br />
file, a database, or from<br />
memory.<br />
Yes<br />
Yes<br />
Yes<br />
The Logger class is a façade that provides<br />
simple methods to log messages.<br />
The TraceListenerCustomFactory class creates<br />
trace listener objects. The LogFormatterCustomFactory<br />
class creates formatter<br />
objects. The LogFilterCustomFactory class<br />
creates filter objects.<br />
The LogWriterFactory class has a constructor<br />
that accepts a configuration source as an<br />
input parameter.<br />
continued