-
Notifications
You must be signed in to change notification settings - Fork 1
Home
fonlow edited this page Apr 19, 2016
·
17 revisions
This component set is for you to construct unit testing and integration testing with dependencies on external resources like services, security and database etc.
The documentation here is minimal. And in the following chapters, if no detailed description is given, you are going to read the doc comments of classes and the cases of the unit testing or integration testing.
Launch IIS Express.
Test case: IntegrationTests.WCFTests.TestGetData
Example config:
<add key="Testing_UseIisExpress" value="True" />
<add key="Testing_HostSite" value="Fonlow.DemoService" />
<add key="Testing_HostSiteApplicationPool" value="Clr4IntegratedAppPool" />
<add key="Testing_SlnRoot" value="C:\VSProjects\FonlowTesting" />
<add key="Testing_BaseUrl" value="http://localhost:4060/" />
Mainly for launching IIS Express only once for one or multiple test classes that talk to the same Website.
Test cases: IntegrationTests.IisExpressFistureTests
For functions of a service class decorated by SecurityPermissionAttribute.
Service function sample:
[PrincipalPermission(SecurityAction.Demand, Role = RoleConstants.Admin)]
public void DeleteAccountByUserName(string userName)
{
RemoveAccountByUserName(userName);
}
Test case sample:
var service2 = new UserManagementImp();
Fonlow.Testing.PermissionPrincipalFixture.SetPrincipal("Admin");
service2.DeleteAccountByUserName(loginName);