public void GetObjectData ()
{
OrderedDictionary coll = new OrderedDictionary (99);
coll.Add ("a", "1");
SerializationInfo si = new SerializationInfo (typeof (OrderedDictionary), new FormatterConverter ());
coll.GetObjectData (si, new StreamingContext ());
foreach (SerializationEntry se in si) {
switch (se.Name) {
case "KeyComparer":
Assert.IsNull (se.Value, se.Name);
break;
case "ReadOnly":
Assert.IsFalse ((bool) se.Value, se.Name);
break;
case "InitialCapacity":
Assert.AreEqual (99, se.Value, se.Name);
break;
case "ArrayList":
Assert.AreEqual ("1", ((DictionaryEntry)((object[]) se.Value)[0]).Value, se.Name);
break;
default:
string msg = String.Format ("Unexpected {0} information of type {1} with value '{2}'.",
se.Name, se.ObjectType, se.Value);
Assert.Fail (msg);
break;
}
}
}