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.
62<br />
<strong>Enterprise</strong> <strong>Library</strong> <strong>Test</strong> <strong>Guide</strong><br />
Code test case Implemented? Feature that is implemented<br />
Verify that the application<br />
block can use a default<br />
instance name to create a<br />
Database-derived object.<br />
Yes<br />
The DatabaseFactory.Create method has<br />
two overloads. One of the methods creates a<br />
Database-derived object from the default instance<br />
name in the configuration source. This<br />
is shown in the following code example.<br />
public static Database CreateDatabase()<br />
{<br />
}<br />
Verify that the application<br />
block exposes configuration<br />
properties for Oracle packages<br />
as public and that they<br />
are configurable.<br />
Verify that the application<br />
block caches parameter discovery<br />
information and then<br />
retrieves it from the cache<br />
when it is required.<br />
Yes<br />
Yes<br />
The section in<br />
the configuration source exposes the configuration<br />
properties for Oracle packages. This is<br />
shown in the following configuration example.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
The OracleConnectionData, OraclePackage-<br />
Data and OracleConnectionSettings classes<br />
read this configuration information.<br />
The ParameterCache class caches the parameters.<br />
The SetParameters method populates<br />
the parameter collection from the cache<br />
if the parameters are already stored there.<br />
This is shown in the following code example.<br />
public void SetParameters(DbCommand<br />
command, Database database)<br />
{<br />
…<br />
if (AlreadyCached(command, database))<br />
{<br />
AddParametersFromCache(command, database);<br />
}<br />
else<br />
{<br />
database.DiscoverParameters(command);<br />
}