/// <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()); }
/// <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>()); }
/// <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()); }