Author: atsushi
Date: 2007-03-14 00:59:52 -0500 (Wed, 14 Mar 2007)
New Revision: 74233
Modified:
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/ChangeLog
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/XmlDictionaryTest.cs
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/XmlSimpleDictionaryWriterTest.cs
Log:
2007-03-14 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlDictionaryTest.cs : removed pointless test-breaking return.
Added test for Add() and key index. Added test for Empty.
* XmlSimpleDictionaryWriterTest.cs : in .NET 3.0 RTM processing
instructions are supported.
Modified:
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/ChangeLog
===================================================================
--- trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/ChangeLog
2007-03-14 05:57:41 UTC (rev 74232)
+++ trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/ChangeLog
2007-03-14 05:59:52 UTC (rev 74233)
@@ -1,3 +1,10 @@
+2007-03-14 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * XmlDictionaryTest.cs : removed pointless test-breaking return.
+ Added test for Add() and key index. Added test for Empty.
+ * XmlSimpleDictionaryWriterTest.cs : in .NET 3.0 RTM processing
+ instructions are supported.
+
2007-03-09 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlDictionaryReaderAbstractTest.cs : added array reader tests.
Modified:
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/XmlDictionaryTest.cs
===================================================================
---
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/XmlDictionaryTest.cs
2007-03-14 05:57:41 UTC (rev 74232)
+++
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/XmlDictionaryTest.cs
2007-03-14 05:59:52 UTC (rev 74233)
@@ -39,7 +39,8 @@
public void SimpleUse ()
{
XmlDictionary d1 = new XmlDictionary ();
-return;
+ XmlDictionaryString dns;
+ Assert.IsFalse (d1.TryLookup (String.Empty, out dns),
"#0");
XmlDictionaryString s1 = d1.Add ("foo");
XmlDictionary d2 = new XmlDictionary ();
XmlDictionaryString s2 = d2.Add ("foo");
@@ -56,5 +57,36 @@
Assert.AreEqual (false, XmlDictionary.Empty.TryLookup
("", out dummy), "#9");
}
+
+ [Test]
+ public void Empty ()
+ {
+ XmlDictionary d = new XmlDictionary ();
+ XmlDictionaryString dns;
+ d.Add (String.Empty);
+ Assert.IsTrue (d.TryLookup (String.Empty, out dns),
"#0");
+ Assert.AreEqual (0, dns.Key, "#1");
+ }
+
+ [Test]
+ public void EmptyAfterAdd ()
+ {
+ XmlDictionary d = new XmlDictionary ();
+ XmlDictionaryString dns;
+ d.Add ("foo");
+ Assert.IsFalse (d.TryLookup (String.Empty, out dns),
"#0");
+ Assert.IsTrue (d.TryLookup ("foo", out dns), "#1");
+ Assert.AreEqual (0, dns.Key, "#2");
+ }
+
+ [Test]
+ public void Add ()
+ {
+ XmlDictionary d = new XmlDictionary ();
+ Assert.AreEqual (0, d.Add ("foo").Key, "#1");
+ Assert.AreEqual (0, d.Add ("foo").Key, "#2");
+ Assert.AreEqual (1, d.Add ("bar").Key, "#3");
+ Assert.AreEqual (2, d.Add ("baz").Key, "#4");
+ }
}
}
Modified:
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/XmlSimpleDictionaryWriterTest.cs
===================================================================
---
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/XmlSimpleDictionaryWriterTest.cs
2007-03-14 05:57:41 UTC (rev 74232)
+++
trunk/olive/class/System.Runtime.Serialization/Test/System.Xml/XmlSimpleDictionaryWriterTest.cs
2007-03-14 05:59:52 UTC (rev 74233)
@@ -458,40 +458,35 @@
}
[Test]
- [ExpectedException (typeof (InvalidOperationException))] //
XmlDictionaryWriter does not support it.
public void ProcessingInstructionValid ()
{
xw.WriteProcessingInstruction("foo", "bar");
- //Assert.AreEqual ("<?foo bar?>", Output,
"WriteProcessingInstruction had incorrect output.");
+ Assert.AreEqual ("<?foo bar?>", Output,
"WriteProcessingInstruction had incorrect output.");
}
[Test]
- [ExpectedException (typeof (InvalidOperationException))] //
XmlDictionaryWriter does not support it.
- //[ExpectedException (typeof (ArgumentException))]
+ [ExpectedException (typeof (ArgumentException))]
public void ProcessingInstructionInvalid1 ()
{
xw.WriteProcessingInstruction("fo?>o", "bar");
}
[Test]
- [ExpectedException (typeof (InvalidOperationException))] //
XmlDictionaryWriter does not support it.
- //[ExpectedException (typeof (ArgumentException))]
+ [ExpectedException (typeof (ArgumentException))]
public void ProcessingInstructionInvalid2 ()
{
xw.WriteProcessingInstruction("foo", "ba?>r");
}
[Test]
- [ExpectedException (typeof (InvalidOperationException))] //
XmlDictionaryWriter does not support it.
- //[ExpectedException (typeof (ArgumentException))]
+ [ExpectedException (typeof (ArgumentException))]
public void ProcessingInstructionInvalid3 ()
{
xw.WriteProcessingInstruction("", "bar");
}
[Test]
- [ExpectedException (typeof (InvalidOperationException))] //
XmlDictionaryWriter does not support it.
- //[ExpectedException (typeof (ArgumentException))]
+ [ExpectedException (typeof (ArgumentException))]
public void ProcessingInstructionInvalid4 ()
{
xw.WriteProcessingInstruction(null, "bar");
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches