/// <summary>
        /// Returns diagnostic messages written to test context and clears from this instance.
        /// </summary>
        /// <param name="testContext">The test context instance.</param>
        /// <returns>The diagnostic messages.</returns>
        internal static string GetAndClearDiagnosticMessages(this ITestContext testContext)
        {
            var messages = testContext.GetDiagnosticMessages();

            testContext.ClearDiagnosticMessages();

            return(messages);
        }