Пример #1
0
        public void BadXmlSetsException()
        {
            xmlView.Xml.Text       = "<NUnitProject>"; // Missing slash
            xmlView.Xml.Validated += Raise.Event <ActionDelegate>();

            Assert.AreEqual("<NUnitProject>", doc.XmlText);
            Assert.NotNull(doc.Exception);
            Assert.IsInstanceOf <XmlException>(doc.Exception);

            XmlException ex = doc.Exception as XmlException;

            xmlView.Received().DisplayError(ex.Message, ex.LineNumber, ex.LinePosition);
        }
Пример #2
0
        public void BadXmlSetsException()
        {
            view.Xml.Text       = "<NUnitProject>"; // Missing slash
            view.Xml.Validated += Raise.Event <ActionHandler>();

            Assert.AreEqual("<NUnitProject>", model.XmlText);
            Assert.NotNull(model.Exception);
            Assert.IsInstanceOf <XmlException>(model.Exception);

            var ex = model.Exception as XmlException;

            view.Received().DisplayError(ex.Message, ex.LineNumber, ex.LinePosition);
        }