public static void MyClassInitialize(TestContext testContext)
 {
     target = new DBPrincipalProvider_Accessor();
     //初始化数据
     /*
      * "<principal-providers>"
                                 + "<provider class=\"CrystalWall.Auths.DBPrincipalProvider\">"
                                 + "<connection>Data Source=**;Initial Catalog=***;User ID=sa;Password=***;</connection>"
                                 + "<!--<conn-provider>数据提供者名称</conn-provider>(可选,默认为sql server提供者)-->"
                                 + "<principal-table>user</principal-table>"
                                 + "<!--<user-indentity>name</user-indentity>(可选,默认为name)-->"
                                 + "<permission-table>permission</permission-table>"
                                 + "<!--以下可选,关联表默认为身份表_权限表"
                                 + "<foreign-table name=\"user_permission\">"
                                 + "  <foreign-user>user_id</foreign-user>"
                                 + "  <foreign-permission>permission_id</foreign-permission>"
                                 + "</foreign-table>-->"
                                 + "</provider>"
                                 + "</principal-providers>";
      */
     target.connectionString = "Data Source=.;Initial Catalog=CrystalwallTest;User ID=sa;Password=123456;";
     target.principaltable = "principal";
     target.permissiontable = "permission";
     target.foreigntable = "principal_permission";
     target.foreignuser = "******";
     target.foreignpermission = "permission_id";
 }
 public static void MyClassInitialize(TestContext testContext)
 {
     PrincipalTokenHolder.Clear();//首先清空
     tokenStorage = new TestPrincipalTokenStorage();
     target = new DBPrincipalProvider_Accessor();
     target.connectionString = "Data Source=.;Initial Catalog=CrystalwallTest;User ID=sa;Password=123456;";
     target.principaltable = "principal";
     target.permissiontable = "permission";
     target.foreigntable = "principal_permission";
     target.foreignuser = "******";
     target.foreignpermission = "permission_id";
     PrincipalTokenHolder.Storage = tokenStorage;
     PrincipalTokenHolder.PrincipalProviders.Add((DBPrincipalProvider)target.Target);
 }