Beispiel #1
0
            public void 暗黙型変換()
            {
                e = new Exception();
                XmlDocument doc = new ErrorDocument(e);

                Assert.That(doc.OuterXml, Is.EqualTo(xmlString));
            }
Beispiel #2
0
        private XmlNode BuildNode(XmlDocument doc)
        {
            XmlNodeBuilder builder = new XmlNodeBuilder("error", doc);

            builder.AddAttribute("message", _error.Message);
            builder.AddAttribute("detail", _error.TargetSite == null ? _error.HelpLink : _error.HelpLink + "\n" + _error.TargetSite);
            builder.AddAttribute("source", _error.Source);
            builder.AddAttribute("stackTrace", _error.StackTrace);

            if (null != _error.InnerException)
            {
                ErrorDocument innerDoc = new ErrorDocument(_error.InnerException);
                ((XmlNode)builder).AppendChild(innerDoc.BuildNode(doc));
            }

            return(builder);
        }