/// <inheritdoc /> protected override void LogAnnotation(AnnotationData annotation) { StringBuilder message = new StringBuilder(); message.AppendFormat("[{0}] ", annotation.Type.ToString().ToLower()); message.Append(annotation.Message); if (annotation.CodeLocation != CodeLocation.Unknown) { message.Append("\n\tLocation: "); message.Append(annotation.CodeLocation); } if (annotation.CodeLocation.Line == 0 && annotation.CodeReference != CodeReference.Unknown) { message.Append("\n\tReference: "); message.Append(annotation.CodeReference); } if (!string.IsNullOrEmpty(annotation.Details)) { message.Append("\n\tDetails: "); message.Append(annotation.Details); } FacadeCategory category = GetCategoryForAnnotation(annotation.Type); testListener.WriteLine(message.ToString(), category); }
public void WriteLine(string text, FacadeCategory category) { if (text == null) throw new ArgumentNullException("text"); try { testListener.WriteLine(text, FacadeUtils.ToCategory(category)); } catch (Exception ex) { throw ServerExceptionUtils.Wrap(ex); } }
public void WriteLine(string text, FacadeCategory category) { if (text == null) { throw new ArgumentNullException("text"); } try { testListener.WriteLine(text, FacadeUtils.ToCategory(category)); } catch (Exception ex) { throw ServerExceptionUtils.Wrap(ex); } }
public static Category ToCategory(FacadeCategory category) { switch (category) { case FacadeCategory.Debug: return Category.Debug; case FacadeCategory.Info: return Category.Info; case FacadeCategory.Warning: return Category.Warning; case FacadeCategory.Error: return Category.Error; case FacadeCategory.Output: return Category.Output; default: throw new ArgumentOutOfRangeException("category"); } }
public static Category ToCategory(FacadeCategory category) { switch (category) { case FacadeCategory.Debug: return(Category.Debug); case FacadeCategory.Info: return(Category.Info); case FacadeCategory.Warning: return(Category.Warning); case FacadeCategory.Error: return(Category.Error); case FacadeCategory.Output: return(Category.Output); default: throw new ArgumentOutOfRangeException("category"); } }