Exemplo n.º 1
0
        /// <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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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");
            }
        }
Exemplo n.º 5
0
        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");
            }
        }