コード例 #1
0
        /// <summary>
        /// Formats and logs test context and test attribute metadata to output window.
        /// </summary>
        /// <param name="context">The information getting logged into that section.</param>
        public static void LogContextAndAttributesToOutput(ITestAutomationContext context)
        {
            _ = context ?? throw new ArgumentNullException(nameof(context));

            Console.WriteLine(context.ToString());
            Console.WriteLine($"{new string('=', 40)}");
        }
コード例 #2
0
 public void TestAutomationBaseCleanup()
 {
     if (!(TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Passed) ||
         Debugger.IsAttached)
     {
         MappedContext = new TestContextAndAttributeMap(TestContext.CurrentContext);
         LogContextAndAttributesToOutput(MappedContext);
     }
 }