diff options
author | Gert Driesen <drieseng@users.sourceforge.net> | 2005-12-27 14:17:32 +0300 |
---|---|---|
committer | Gert Driesen <drieseng@users.sourceforge.net> | 2005-12-27 14:17:32 +0300 |
commit | 18476997c6b1987d6722af42b8f413af8ea579ed (patch) | |
tree | a3e81b85bcede4903293c6ed441dc9275d68e9b1 /mcs/class/System.XML | |
parent | f6b46ed5f8fdb8053bed6377c7398d7dc3c6fb68 (diff) |
* XmlTextWriterTests.cs: Added tests for WriteWhitespace and WriteNmToken.
svn path=/trunk/mcs/; revision=54867
Diffstat (limited to 'mcs/class/System.XML')
-rw-r--r-- | mcs/class/System.XML/Test/System.Xml/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs | 43 |
2 files changed, 48 insertions, 0 deletions
diff --git a/mcs/class/System.XML/Test/System.Xml/ChangeLog b/mcs/class/System.XML/Test/System.Xml/ChangeLog index 242468689e0..164d6048111 100644 --- a/mcs/class/System.XML/Test/System.Xml/ChangeLog +++ b/mcs/class/System.XML/Test/System.Xml/ChangeLog @@ -1,5 +1,10 @@ 2005-12-27 Gert Driesen <drieseng@users.sourceforge.net> + * XmlTextWriterTests.cs: Added tests for WriteWhitespace and + WriteNmToken. + +2005-12-27 Gert Driesen <drieseng@users.sourceforge.net> + * NameTableTests.cs: Added additional tests for Add and Get methods. 2005-12-27 Gert Driesen <drieseng@users.sourceforge.net> diff --git a/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs b/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs index a70f1a124d0..0108029fe0a 100644 --- a/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs +++ b/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs @@ -1513,6 +1513,49 @@ namespace MonoTests.System.Xml } [Test] + [ExpectedException (typeof (ArgumentException))] + public void WriteWhitespace_Null () + { + xtw.WriteWhitespace ((string) null); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void WriteWhitespace_Empty () + { + xtw.WriteWhitespace (string.Empty); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void WriteNmToken_Null () + { + xtw.WriteNmToken ((string) null); + } + + [Test] + [ExpectedException (typeof (ArgumentException))] + public void WriteNmToken_Empty () + { + xtw.WriteNmToken (string.Empty); + } + + [Test] + [Category ("NotWorking")] // on mono, an XmlException is thrown instead + [ExpectedException (typeof (ArgumentException))] + public void WriteNmToken_InvalidChars () + { + xtw.WriteNmToken ("\uFFFF"); + } + + [Test] + public void WriteNmToken () + { + xtw.WriteNmToken ("some:name"); + Assert.AreEqual ("some:name", StringWriterText); + } + + [Test] public void XmlSpaceRaw () { xtw.WriteStartElement ("foo"); |