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 Security Application Block 121<br />

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

public override void SavePrincipal(IPrincipal principal,<br />

IToken token){…}<br />

public override IToken SaveProfile(object profile){…}<br />

public override void SaveProfile(object profile, IToken<br />

token) {…}<br />

public override void ExpireIdentity(IToken token){…}<br />

public override void ExpirePrincipal(IToken token){…}<br />

public override void ExpireProfile(IToken token){…}<br />

public override IIdentity GetIdentity(IToken token){…}<br />

public override IPrincipal GetPrincipal(IToken token){…}<br />

public override object GetProfile(IToken token){…}<br />

}<br />

The following is the test.<br />

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

public void CreateCustomSecurityCache()<br />

{<br />

SecurityCacheProviderFactory factory = new SecurityC<br />

acheProviderFactory(new SecurityCachingDictSource().<br />

BuildDictionarySourceSection());<br />

ISecurityCacheProvider cacheProvider = factory.<br />

Create("MyCache");<br />

Assert.IsNotNull(cacheProvider);<br />

}

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

Saved successfully!

Ooh no, something went wrong!