tools/VsIdeHostAdapter/TargetAddIn/AgentSide/VsIdeHostAdapter.cs
/// <summary>
/// Sends run level message to the result sink.
/// </summary>
/// <param name="message">Text for the message.</param>
/// <param name="outcome">Outcome for the message. Affects test run outcome.</param>
/// <param name="abortTestRun">If true, we use TMK.Panic, otherwise TMK.TextMessage</param>
Sends run level message to the result sink.
Sends run level message to the result sink .
private void SendResult(string messageText, TestOutcome outcome, bool abortTestRun)
        {
            TakeScreenShot("ScreenShot_TestRunAborted");
            Debug.Assert(!abortTestRun || outcome == TestOutcome.Error,
                "HA.SendResult: When abortTestRun = true, Outcome should be Error.");
            String events = GetEvents(m_runContext.RunConfig.TestRun.Created, DateTime.Now, true);
            String abortMessage = String.Empty;
            if (events != String.Empty)
            {
                abortMessage = String.Format("{0}{1}{2}", messageText, Environment.NewLine, events);
            }
            else
            {
                abortMessage = messageText;
            }
            TestRunTextResultMessage message = new TestRunTextResultMessage(
                Environment.MachineName,
                m_runContext.RunConfig.TestRun.Id,
                abortMessage,
                TestMessageKind.TextMessage);
            message.Outcome = outcome;
            m_runContext.ResultSink.AddResult(message);
            if (abortTestRun)
            {
                m_runContext.ResultSink.AddResult(new RunStateEvent(m_runContext.RunConfig.TestRun.Id,
                                                                RunState.Aborting,
                                                                Environment.MachineName));
            }
        }
private void SendResult ( string messageText , TestOutcome outcome , bool abortTestRun ) { TakeScreenShot ( " " ) ; Debug . Assert ( ! abortTestRun || outcome == TestOutcome . Error , " " ) ; String events = GetEvents ( m_runContext . RunConfig . TestRun . Created , DateTime . Now , true ) ; String abortMessage = String . Empty ; if ( events != String . Empty ) { abortMessage = String . Format ( " " , messageText , Environment . NewLine , events ) ; } else { abortMessage = messageText ; } TestRunTextResultMessage message = new TestRunTextResultMessage ( Environment . MachineName , m_runContext . RunConfig . TestRun . Id , abortMessage , TestMessageKind . TextMessage ) ; message . Outcome = outcome ; m_runContext . ResultSink . AddResult ( message ) ; if ( abortTestRun ) { m_runContext . ResultSink . AddResult ( new RunStateEvent ( m_runContext . RunConfig . TestRun . Id , RunState . Aborting , Environment . MachineName ) ) ; } }
Sends run level message to the result sink.
Sends run level message to the result sink .
messageText
string
outcome
TestOutcome
Outcome for the message. Affects test run outcome.
Outcome for the message . Affects test run outcome .
abortTestRun
bool
If true, we use TMK.Panic, otherwise TMK.TextMessage
If true we use TMK . Panic otherwise TMK . TextMessage
message
Text for the message.
Text for the message .