public void SerializationInfoEnumerate()
{
var value = new Serializable();
var si = new SerializationInfo(typeof(Serializable), new FormatterConverter());
var sc = new StreamingContext();
value.GetObjectData(si, sc);
int items = 0;
foreach (SerializationEntry entry in si)
{
items++;
switch (entry.Name)
{
case "int":
Assert.Equal(int.MaxValue, (int)entry.Value);
Assert.Equal(typeof(int), entry.ObjectType);
break;
case "string":
Assert.Equal("hello", (string)entry.Value);
Assert.Equal(typeof(string), entry.ObjectType);
break;
case "bool":
Assert.Equal(true, (bool)entry.Value);
Assert.Equal(typeof(bool), entry.ObjectType);
break;
}
}
Assert.Equal(si.MemberCount, items);
}