Example #1
0
        private void StartApplication()
        {
            var appConfig     = new AppSettings();
            var mockAppConfig = new MockAppSettings();

            Configuration.Bind("AppSettings", appConfig);
            Configuration.Bind("MockAppSettings", mockAppConfig);
            Configuration.Bind(mockAppConfig);

            if (!string.IsNullOrEmpty(mockAppConfig.ENV_SERVICESERVER_URL))
            {
                // MOCK限定
                // サービスサーバのURLが設定されている場合は、DAOが使用するサービスサーバのURLとして設定する。
                appConfig.ServiceServerUrl = mockAppConfig.ENV_SERVICESERVER_URL;
            }

            mContainer.RegisterInstance(appConfig);
            mContainer.RegisterInstance(mockAppConfig);

            // 設定のダンプ
            mLogger.Info($"Settings: ServiceServerUrl={appConfig.ServiceServerUrl}");
            mLogger.Info($"Settings: EnableMockDao={mockAppConfig.EnableMockDao}");

            // Ipcマネージャの初期化
            var frontendIpcMessageBridge = new PseudoFrontentIpcMessageBridge();
            var ipcBridge = new IpcBridge(mContainer, frontendIpcMessageBridge);

            mContainer.RegisterInstance <IRequestHandlerFactory> (ipcBridge.Initialize());

            // ServiceDistorionマネージャの初期化
            mContainer.Register <IServiceDistoributor, ServiceDistoributionManager> (Lifestyle.Singleton);

            // Intentマネージャの初期化
            mContainer.RegisterSingleton <IIntentManager, IntentManager> ();

            // Screenマネージャの初期化
            mContainer.RegisterSingleton <IScreenManager, ScreenManager> ();

            // Ipcメッセージブリッジの初期化
            mContainer.RegisterInstance <IFrontendIpcMessageBridge> (frontendIpcMessageBridge);

            // 各種HandlerFactoryの登録
            mContainer.RegisterInstance <ServiceDistributionResolveHandlerFactory> (new ServiceDistributionResolveHandlerFactory(mContainer));
            mContainer.RegisterInstance <ServiceMessageResolveHandlerFactory> (new ServiceMessageResolveHandlerFactory(mContainer));
            mContainer.RegisterInstance <IpcSendResolveHandlerFactory> (new IpcSendResolveHandlerFactory(mContainer));

            if (mockAppConfig.EnableMockDao)
            {
                IntegrateMockDao();
            }
            else
            {
                IntegrateDao();
            }

            mContainer.Verify();

            mContainer.GetInstance <WorkflowService.Handler> ().Initialize(); // 手動での初期化
        }
Example #2
0
 public void Must_Get_Resource_From_App_Settings()
 {
     MockAppSettings.Verify(x => x.QuestionnaireServiceResourceGet(), Times.Once);
 }
Example #3
0
 public void Must_Get_Base_Url_From_App_Settings()
 {
     MockAppSettings.Verify(x => x.QuestionnaireServiceBaseUri(), Times.Once);
 }
Example #4
0
 public void Dispose()
 {
     MockAppSettings.Remove("UrlShortenerService", "UrlShortenerServiceToken");
 }
Example #5
0
 public override void Dispose()
 {
     base.Dispose();
     MockAppSettings.Remove("PublicKey", "PublicSalt");
 }
 public new void Dispose()
 {
     base.Dispose();
     network.Dispose();
     MockAppSettings.Remove("eSpaceEventService.BaseUrl");
 }
Example #7
0
 public override void Dispose()
 {
     base.Dispose();
     MockAppSettings.Remove("sysfromemail");
 }