コード例 #1
0
        /// <summary>
        /// Returns the last <see cref="TesExecutorLog"/>. Adds it if none exist.
        /// </summary>
        /// <param name="tesTaskLog"><see cref="TesTaskLog"/></param>
        /// <returns>Initialized <see cref="TesExecutorLog"/></returns>
        public static TesExecutorLog GetOrAddExecutorLog(this TesTaskLog tesTaskLog)
        {
            if (tesTaskLog.Logs == null || !tesTaskLog.Logs.Any())
            {
                tesTaskLog.Logs = new List <TesExecutorLog> {
                    new TesExecutorLog()
                };
            }

            return(tesTaskLog.Logs.Last());
        }
コード例 #2
0
 /// <summary>
 /// Returns the Metadata property of <see cref="TesTaskLog"/>. Adds it if it doesn't exist.
 /// </summary>
 /// <param name="tesTaskLog"><see cref="TesTaskLog"/></param>
 /// <returns>Initialized Metadata property</returns>
 public static Dictionary <string, string> GetOrAddMetadata(this TesTaskLog tesTaskLog)
 {
     return(tesTaskLog.Metadata ??= new Dictionary <string, string>());
 }
コード例 #3
0
 /// <summary>
 /// Returns the <see cref="BatchNodeMetrics"/>. Adds it if it doesn't exist.
 /// </summary>
 /// <param name="tesTaskLog"><see cref="TesTaskLog"/></param>
 /// <returns>Initialized <see cref="BatchNodeMetrics"/></returns>
 public static BatchNodeMetrics GetOrAddBatchNodeMetrics(this TesTaskLog tesTaskLog)
 {
     return(tesTaskLog.BatchNodeMetrics ??= new BatchNodeMetrics());
 }
コード例 #4
0
 /// <summary>
 /// Returns the <see cref="BatchNodeMetrics"/>. Adds it if it doesn't exist.
 /// </summary>
 /// <param name="tesTaskLog"><see cref="TesTaskLog"/></param>
 /// <returns>Initialized <see cref="BatchNodeMetrics"/></returns>
 public static BatchNodeMetrics GetOrAddBatchNodeMetrics(this TesTaskLog tesTaskLog)
 => tesTaskLog.BatchNodeMetrics ??= new BatchNodeMetrics();