コード例 #1
0
        protected override void TestInitialize()
        {
            base.TestInitialize();

            // check parameters before each test case
            EnvironmentConfig.CheckParameters(TestSite);

            // create the request handler factory instance
            Factory = new ProxyRequestHandlerFactory(ServerDataModel);

            // register common request handlers used by all cases
            Factory.RegisterRequestHandler <GetProxyStoreEntryRequestHandler>();
            Factory.RegisterRequestHandler <PutProxyStoreEntryRequestHandler>();
            Factory.RegisterRequestHandler <GetProxyRelyingPartyTrustRequestHandler>();
            Factory.RegisterRequestHandler <GetConfigurationRequestHandler>();
            Factory.RegisterRequestHandler <PostProxyRenewTrustRequestHandler>();
            Factory.RegisterRequestHandler <PostProxyStoreEntryRequestHandler>();
            Factory.RegisterRequestHandler <RelyingPartyTokenHandler>();
            Factory.DefaultRequestHander = new UnknownRequestHandler();

            // these are common variables used by every test cases
            VerifyMessage   = string.Empty;
            CurrentRequest  = null;
            CurrentResponse = null;
            CurrentHandler  = null;
        }
コード例 #2
0
        public static void BaseInitialize(TestContext context)
        {
            TestClassBase.Initialize(context);

            // load ptfconfig properties
            EnvironmentConfig.LoadParameters(BaseTestSite);
            EnvironmentConfig.CheckParameters(BaseTestSite);

            // initialize controller adapter
            SutAdapter      = BaseTestSite.GetAdapter <ISUTControlAdapter>();
            AsyncSutAdapter = new SUTControlAdapterAsync(SutAdapter);

            // initialize client adapter
            ClientAdapter = BaseTestSite.GetAdapter <IMSADFSPIPClientAdapter>();
            if (!m_sslCertBinded)
            {
                ClientAdapter.BindCertificate(new X509Certificate2(
                                                  EnvironmentConfig.TLSServerCertificatePath,
                                                  EnvironmentConfig.TLSServerCertificatePassword));
                m_sslCertBinded = true;
            }

            // initialize server data model and handler factory
            ServerDataModel = ServerDataModel.InitiateServerDataModel();
        }