tools/VsIdeHostAdapter/TargetAddIn/AgentSide/VsIdeHostAdapter.cs
/// <summary>
/// IBaseAdapter method: called to execute a test.
/// </summary>
/// <param name="testElement">The test object to run</param>
/// <param name="testContext">The Test conext for this test invocation</param>
IBaseAdapter method: called to execute a test.
IBaseAdapter method : called to execute a test .
void IBaseAdapter.Run(ITestElement testElement, ITestContext testContext)
        {
            PrePostHostCodeExecution(testElement, testContext, ExecutionType.PreHost);
            CheckRestartVs();
            DateTime testStartTime = DateTime.Now;
            try
            {
                ((ITestAdapter)m_hostSide).Run(testElement, testContext);
                Trace.WriteLine("RUN method completed.....");
                if (m_runContext.RunConfig.TestRun.Result.Outcome != TestOutcome.Passed &&
                    m_runContext.RunConfig.TestRun.Result.Outcome != TestOutcome.PassedButRunAborted)
                    TakeScreenShot("ScreenShot_" + m_runContext.RunConfig.TestRun.Result.Outcome.ToString() + "_" + testElement.Name);
            }
            catch (RemotingException remotingException)
            {
                AbortSingleTestResult("Remoting Exception in IBaseAdapter.Run(): " + remotingException.Message, testElement, testStartTime);
            }
            m_isHostSideDirty = true;
            PrePostHostCodeExecution(testElement, testContext, ExecutionType.PostHost);
        }
void IBaseAdapter . Run ( ITestElement testElement , ITestContext testContext ) { PrePostHostCodeExecution ( testElement , testContext , ExecutionType . PreHost ) ; CheckRestartVs ( ) ; DateTime testStartTime = DateTime . Now ; try { ( ( ITestAdapter ) m_hostSide ) . Run ( testElement , testContext ) ; Trace . WriteLine ( " " ) ; if ( m_runContext . RunConfig . TestRun . Result . Outcome != TestOutcome . Passed && m_runContext . RunConfig . TestRun . Result . Outcome != TestOutcome . PassedButRunAborted ) TakeScreenShot ( " " + m_runContext . RunConfig . TestRun . Result . Outcome . ToString ( ) + " " + testElement . Name ) ; } catch ( RemotingException remotingException ) { AbortSingleTestResult ( " " + remotingException . Message , testElement , testStartTime ) ; } m_isHostSideDirty = true ; PrePostHostCodeExecution ( testElement , testContext , ExecutionType . PostHost ) ; }
IBaseAdapter method: called to execute a test.
IBaseAdapter method : called to execute a test .
testElement
ITestElement
The test object to run
The test object to run
testContext
ITestContext
The Test conext for this test invocation
The Test conext for this test invocation