コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProxyExecutionManager"/> class.
        /// </summary>
        ///
        /// <param name="testSessionInfo">The test session info.</param>
        /// <param name="debugEnabledForTestSession">
        /// A flag indicating if debugging should be enabled or not.
        /// </param>
        public ProxyExecutionManager(TestSessionInfo testSessionInfo, bool debugEnabledForTestSession)
        {
            // Filling in test session info and proxy information.
            this.testSessionInfo       = testSessionInfo;
            this.ProxyOperationManager = TestSessionPool.Instance.TakeProxy(this.testSessionInfo);
            // This should be set to enable debugging when we have test session info available.
            this.debugEnabledForTestSession = debugEnabledForTestSession;

            this.testHostManager            = this.ProxyOperationManager.TestHostManager;
            this.dataSerializer             = JsonDataSerializer.Instance;
            this.isCommunicationEstablished = false;
            this.requestData = this.ProxyOperationManager.RequestData;
            this.fileHelper  = new FileHelper();
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProxyExecutionManager"/> class.
        /// </summary>
        ///
        /// <remarks>
        /// Constructor with dependency injection. Used for unit testing.
        /// </remarks>
        ///
        /// <param name="requestData">The request data for common services and data for run.</param>
        /// <param name="requestSender">Request sender instance.</param>
        /// <param name="testHostManager">Test host manager instance.</param>
        /// <param name="dataSerializer">Data serializer instance.</param>
        /// <param name="fileHelper">File helper instance.</param>
        internal ProxyExecutionManager(
            IRequestData requestData,
            ITestRequestSender requestSender,
            ITestRuntimeProvider testHostManager,
            IDataSerializer dataSerializer,
            IFileHelper fileHelper)
        {
            this.testHostManager            = testHostManager;
            this.dataSerializer             = dataSerializer;
            this.isCommunicationEstablished = false;
            this.requestData = requestData;
            this.fileHelper  = fileHelper;

            // Create a new proxy operation manager.
            this.ProxyOperationManager = new ProxyOperationManager(requestData, requestSender, testHostManager, this);
        }