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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

108<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<br />

the application<br />

block can<br />

use default<br />

instance<br />

names that<br />

are defined in<br />

the configuration<br />

source<br />

to create the<br />

authorization<br />

providers and<br />

the security<br />

cache providers.<br />

Verify that<br />

the application<br />

block can also<br />

use specific instance<br />

names<br />

to create<br />

these providers.<br />

Yes<br />

The AuthorizationProviderFactory. CreateDefault method<br />

creates AuthorizationProvider-derived objects with the default<br />

instance name specified in the configuration source. The<br />

AuthorizationProviderFactory. Create method creates AuthorizationProvider-derived<br />

objects with the specified instance<br />

name. The SecurityCacheFactory class has similar methods<br />

to create security cache providers. The following code shows<br />

the two AuthorizationProviderFactory methods.<br />

public static IAuthorizationProvider GetAuthorizationProvider()<br />

{<br />

…<br />

return factory.CreateDefault();<br />

}<br />

public static IAuthorizationProvider GetAuthorizati<br />

onProvider(string authorizationProviderName)<br />

{<br />

…<br />

return factory.Create(authorizationProviderName);<br />

}

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

Saved successfully!

Ooh no, something went wrong!