ToXml() public method

Outputs the Element to a string as xml
public ToXml ( ) : string
return string
Ejemplo n.º 1
0
        public string markAsException(string fragment, string expression, string errorMessage)
        {
            var exception = new StackTraceSettingException(errorMessage);
            exception.StackTraceElements.AddRange(stackTraceElements);

            var document = new TestRig()
                                .ProcessFragment(fragment)
                                .GetXDocument();

            var element = new Element(document.Descendants("p").ToArray()[0]);

            new ExceptionRenderer().ExceptionCaught(new ExceptionCaughtEvent(exception, element, expression));

            return element.ToXml();
        }