示例#1
0
        public void TestFixtureSetUp()
        {
            _hogController = new HeartOfGoldController
            {
                RuntimeDir       = HogHelper.RuntimeDir,
                ConfigDir        = HogHelper.ConfigDirParam,
                ExecutionTimeout = 120
            };

            Console.WriteLine("Starting HeartOfGold");

            var started = _hogController.StartApplication();

            _hogController.CreateClients();

            Assert.IsTrue(started, "Can't start HeartOfGold.");
            Assert.IsFalse(_hogController.Process.HasExited, "HeartOfGold has exited unexpectedly.");

            var result = _hogController.WaitForService(DependentTestModule.ModuleController.ModuleName, ServerModuleState.Running, 10);

            Assert.IsTrue(result, "Service 'TestModule' did not reach state 'Running'");

            _versionService = new VersionServiceManager(new ProxyConfig(), "localhost", _hogController.HttpPort);

            Assert.NotNull(_versionService, "Can't create VersionServiceClient");
        }
        /// <summary>
        /// Initializes this factory.
        /// </summary>
        /// <param name="factoryConfig">The configuration of this factory.</param>
        /// <param name="proxyConfig">An optional proxy configuration.</param>
        /// <param name="threadContext">For WPF applications, an instance of WpfThreadContext should be passed here.
        /// For console applications or Windows services an instance of SimpleThreadContext should be used instead.</param>
        protected void Initialize(IWcfClientFactoryConfig factoryConfig, IProxyConfig proxyConfig, IThreadContext threadContext)
        {
            _factoryConfig = factoryConfig;
            _proxyConfig   = proxyConfig;
            _threadContext = threadContext;

            VersionService = new VersionServiceManager(proxyConfig, factoryConfig.Host, factoryConfig.Port);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseWcfClientFactory"/> class.
 /// </summary>
 protected BaseWcfClientFactory()
 {
     VersionService = new VersionServiceManager();
 }