All pastes #387287 Raw Edit

atsushieno

public text v1 · immutable
·published 2007-03-09 06:34 UTC
rendered paste body
[Test]
public void ReadArrayBoolean ()
{
	XmlDictionaryReader r = GetReader ("<root>true false true</root>");
	r.Read ();
	bool [] array = new bool [5];
	r.ReadArray ("root", "", array, 1, 3);
	Assert.AreEqual (true, array [1], "#1");
	Assert.AreEqual (false, array [2], "#2");
	Assert.AreEqual (true, array [3], "#3");
}

/*

3) MonoTests.System.Xml.XmlDictionaryReaderAbstractTest.ReadArrayBoolean : System.Xml.XmlException : Content cannot be converted to the type Boolean.
  ----> System.FormatException : The string 'true false true' is not a valid Boolean value.
   at System.Xml.XmlReader.ReadContentAsBoolean()
   at System.Xml.XmlDictionaryReader.ReadElementContentAsBoolean()
   at System.Xml.XmlDictionaryReader.ReadArray(String localName, String namespaceUri, Boolean[] array, Int32 offset, Int32 count)
   at MonoTests.System.Xml.XmlDictionaryReaderAbstractTest.ReadArrayBoolean()
--XmlException
   at System.Xml.XmlConvert.ToBoolean(String s)
   at System.Xml.XmlReader.ReadContentAsBoolean()

*/