From 623bd3182da740a7a1cbade87dd340dd8cd68267 Mon Sep 17 00:00:00 2001 From: Jericho Date: Wed, 16 Nov 2022 19:01:38 -0500 Subject: [PATCH 1/2] Refactor CodeDomComponentSerializationService to use List and List instead of ArrayList --- .../CodeDomComponentSerializationService.cs | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.cs b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.cs index aa5edb5eaf1..3e481cd151a 100644 --- a/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.cs +++ b/src/System.Windows.Forms.Design/src/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationService.cs @@ -196,7 +196,7 @@ private sealed class CodeDomSerializationStore : SerializationStore, ISerializab private readonly IServiceProvider _provider; // These fields persist across the store - private readonly ArrayList _objectNames; + private readonly List _objectNames; private Hashtable _objectState; private LocalResourceManager _resources; private AssemblyName[] _assemblies; @@ -212,7 +212,7 @@ internal CodeDomSerializationStore(IServiceProvider provider) { _provider = provider; _objects = new Hashtable(); - _objectNames = new ArrayList(); + _objectNames = new List(); _shimObjectNames = new List(); } @@ -613,7 +613,7 @@ private class ComponentListCodeDomSerializer : CodeDomSerializer { internal static ComponentListCodeDomSerializer s_instance = new ComponentListCodeDomSerializer(); private Hashtable _statementsTable; - Dictionary _expressions; + Dictionary> _expressions; private Hashtable _objectState; // only used during deserialization private bool _applyDefaults = true; private readonly Hashtable _nameResolveGuard = new Hashtable(); @@ -636,15 +636,9 @@ private void PopulateCompleteStatements(object data, string name, CodeStatementC else if (data is CodeExpression expression) { // we handle expressions a little differently since they don't have a LHS or RHS they won't show up correctly in the statement table. We will deserialize them explicitly. - ArrayList exps = null; - if (_expressions.ContainsKey(name)) + if (!_expressions.TryGetValue(name, out List exps)) { - exps = _expressions[name]; - } - - if (exps is null) - { - exps = new ArrayList(); + exps = new(); _expressions[name] = exps; } @@ -662,7 +656,7 @@ private void PopulateCompleteStatements(object data, string name, CodeStatementC internal void Deserialize(IDesignerSerializationManager manager, IDictionary objectState, IList objectNames, bool applyDefaults) { CodeStatementCollection completeStatements = new CodeStatementCollection(); - _expressions = new Dictionary(); + _expressions = new(); _applyDefaults = applyDefaults; foreach (string name in objectNames) { @@ -957,7 +951,7 @@ private bool ResolveName(IDesignerSerializationManager manager, string name, boo DeserializeModifier(manager, name, state[StateModifier]); } - if (_expressions.TryGetValue(name, out ArrayList exps)) + if (_expressions.TryGetValue(name, out List exps)) { foreach (CodeExpression exp in exps) { @@ -974,7 +968,7 @@ private bool ResolveName(IDesignerSerializationManager manager, string name, boo if (!resolved) { // this is condition 2 of the comment at the start of this method. - if (_expressions.TryGetValue(name, out ArrayList exps)) + if (_expressions.TryGetValue(name, out List exps)) { foreach (CodeExpression exp in exps) { From 8da2c0adff5321057f2197586c85332c484a1d54 Mon Sep 17 00:00:00 2001 From: Jericho Date: Wed, 16 Nov 2022 19:44:55 -0500 Subject: [PATCH 2/2] Fix unit tests --- ...deDomComponentSerializationServiceTests.cs | 102 +++++++++--------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/src/System.Windows.Forms.Design/tests/UnitTests/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationServiceTests.cs b/src/System.Windows.Forms.Design/tests/UnitTests/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationServiceTests.cs index ae6cd528f8c..eb134b1c73d 100644 --- a/src/System.Windows.Forms.Design/tests/UnitTests/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationServiceTests.cs +++ b/src/System.Windows.Forms.Design/tests/UnitTests/System/ComponentModel/Design/Serialization/CodeDomComponentSerializationServiceTests.cs @@ -157,8 +157,8 @@ public void CreateStore_CloseSerialize_Success() Assert.Null(valueState2[4]); Assert.Null(valueState2[5]); - ArrayList names = Assert.IsType(info.GetValue("Names", typeof(ArrayList))); - Assert.Equal(new ArrayList { "name1", "name2" }, names); + List names = Assert.IsType>(info.GetValue("Names", typeof(List))); + Assert.Equal(new List { "name1", "name2" }, names); AssemblyName[] assemblies = Assert.IsType(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Equal(typeof(DataClass).Assembly.GetName(true).FullName, Assert.Single(assemblies).FullName); @@ -250,7 +250,7 @@ public void CreateStore_CloseSerializeWithInvalidProvider_Success(object result) Assert.Null(valueState[4]); Assert.Null(valueState[5]); - ArrayList names = Assert.IsType(info.GetValue("Names", typeof(ArrayList))); + List names = Assert.IsType>(info.GetValue("Names", typeof(List))); Assert.Equal("name", Assert.Single(names)); AssemblyName[] assemblies = Assert.IsType(info.GetValue("Assemblies", typeof(AssemblyName[]))); @@ -357,7 +357,7 @@ public void CreateStore_CloseSerializeWithValidProvider_Success(object component Assert.Null(valueState[4]); Assert.Null(valueState[5]); - ArrayList names = Assert.IsType(info.GetValue("Names", typeof(ArrayList))); + List names = Assert.IsType>(info.GetValue("Names", typeof(List))); Assert.Equal("name", Assert.Single(names)); AssemblyName[] assemblies = Assert.IsType(info.GetValue("Assemblies", typeof(AssemblyName[]))); @@ -407,7 +407,7 @@ public void CreateStore_CloseSerializeAbsolute_Success() Assert.Null(valueState[4]); Assert.Null(valueState[5]); - ArrayList names = Assert.IsType(info.GetValue("Names", typeof(ArrayList))); + List names = Assert.IsType>(info.GetValue("Names", typeof(List))); Assert.Equal("name", Assert.Single(names)); AssemblyName[] assemblies = Assert.IsType(info.GetValue("Assemblies", typeof(AssemblyName[]))); @@ -458,7 +458,7 @@ public void CreateStore_CloseSerializeMember_Success() Assert.Null(valueState[4]); Assert.Null(valueState[5]); - ArrayList names = Assert.IsType(info.GetValue("Names", typeof(ArrayList))); + List names = Assert.IsType>(info.GetValue("Names", typeof(List))); Assert.Equal("name", Assert.Single(names)); AssemblyName[] assemblies = Assert.IsType(info.GetValue("Assemblies", typeof(AssemblyName[]))); @@ -509,7 +509,7 @@ public void CreateStore_CloseSerializeMemberAbsolute_Success() Assert.Null(valueState[4]); Assert.Null(valueState[5]); - ArrayList names = Assert.IsType(info.GetValue("Names", typeof(ArrayList))); + List names = Assert.IsType>(info.GetValue("Names", typeof(List))); Assert.Equal("name", Assert.Single(names)); AssemblyName[] assemblies = Assert.IsType(info.GetValue("Assemblies", typeof(AssemblyName[]))); @@ -563,7 +563,7 @@ public void CreateStore_CloseSerializeThenSerializeMember_Success() Assert.Null(valueState[4]); Assert.Null(valueState[5]); - ArrayList names = Assert.IsType(info.GetValue("Names", typeof(ArrayList))); + List names = Assert.IsType>(info.GetValue("Names", typeof(List))); Assert.Equal("name", Assert.Single(names)); AssemblyName[] assemblies = Assert.IsType(info.GetValue("Assemblies", typeof(AssemblyName[]))); @@ -617,7 +617,7 @@ public void CreateStore_CloseSerializeMemberThenSerialize_Success() Assert.Null(valueState[4]); Assert.Null(valueState[5]); - ArrayList names = Assert.IsType(info.GetValue("Names", typeof(ArrayList))); + List names = Assert.IsType>(info.GetValue("Names", typeof(List))); Assert.Equal("name", Assert.Single(names)); AssemblyName[] assemblies = Assert.IsType(info.GetValue("Assemblies", typeof(AssemblyName[]))); @@ -673,7 +673,7 @@ public void CreateStore_ISerializableGetObjectDataDefault_Success() serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - Assert.Empty(Assert.IsType(info.GetValue("Names", typeof(ArrayList)))); + Assert.Empty(Assert.IsType>(info.GetValue("Names", typeof(List)))); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); Assert.Empty(Assert.IsType>(info.GetValue("Shim", typeof(List)))); @@ -691,7 +691,7 @@ public void CreateStore_ISerializableGetObjectDataSerialized_Success() var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - Assert.NotEmpty(Assert.IsType(info.GetValue("Names", typeof(ArrayList)))); + Assert.NotEmpty(Assert.IsType>(info.GetValue("Names", typeof(List)))); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); Assert.Empty(Assert.IsType>(info.GetValue("Shim", typeof(List)))); @@ -739,7 +739,7 @@ public void Serialize_InvokeObject_Success() var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -750,7 +750,7 @@ public void Serialize_InvokeObject_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -776,7 +776,7 @@ public void Serialize_InvokeIComponentWithoutSite_Success() var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -789,7 +789,7 @@ public void Serialize_InvokeIComponentWithoutSite_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -824,7 +824,7 @@ public void Serialize_InvokeIComponentWithISite_Success(string name, int expecte var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -838,7 +838,7 @@ public void Serialize_InvokeIComponentWithISite_Success(string name, int expecte info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -883,7 +883,7 @@ public void Serialize_InvokeIComponentWithINestedSite_Success(string fullName, i var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -896,7 +896,7 @@ public void Serialize_InvokeIComponentWithINestedSite_Success(string fullName, i info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -947,7 +947,7 @@ public void SerializeAbsolute_InvokeObject_Success() var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -958,7 +958,7 @@ public void SerializeAbsolute_InvokeObject_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -984,7 +984,7 @@ public void SerializeAbsolute_InvokeIComponentWithoutSite_Success() var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -997,7 +997,7 @@ public void SerializeAbsolute_InvokeIComponentWithoutSite_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1032,7 +1032,7 @@ public void SerializeAbsolute_InvokeIComponentWithISite_Success(string name, int var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1046,7 +1046,7 @@ public void SerializeAbsolute_InvokeIComponentWithISite_Success(string name, int info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1091,7 +1091,7 @@ public void SerializeAbsolute_InvokeIComponentWithINestedSite_Success(string ful var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1104,7 +1104,7 @@ public void SerializeAbsolute_InvokeIComponentWithINestedSite_Success(string ful info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1157,7 +1157,7 @@ public void SerializeMember_InvokeObject_Success() var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1168,7 +1168,7 @@ public void SerializeMember_InvokeObject_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1179,7 +1179,7 @@ public void SerializeMember_InvokeObject_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1207,7 +1207,7 @@ public void SerializeMember_InvokeIComponentWithoutSite_Success() var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1220,7 +1220,7 @@ public void SerializeMember_InvokeIComponentWithoutSite_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1233,7 +1233,7 @@ public void SerializeMember_InvokeIComponentWithoutSite_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1270,7 +1270,7 @@ public void SerializeMember_InvokeIComponentWithISite_Success(string name, int e var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1284,7 +1284,7 @@ public void SerializeMember_InvokeIComponentWithISite_Success(string name, int e info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1298,7 +1298,7 @@ public void SerializeMember_InvokeIComponentWithISite_Success(string name, int e info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1345,7 +1345,7 @@ public void SerializeMember_InvokeIComponentWithINestedSite_Success(string fullN var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1358,7 +1358,7 @@ public void SerializeMember_InvokeIComponentWithINestedSite_Success(string fullN info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1371,7 +1371,7 @@ public void SerializeMember_InvokeIComponentWithINestedSite_Success(string fullN info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1436,7 +1436,7 @@ public void SerializeMemberAbsolute_InvokeObject_Success() var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1447,7 +1447,7 @@ public void SerializeMemberAbsolute_InvokeObject_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1458,7 +1458,7 @@ public void SerializeMemberAbsolute_InvokeObject_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1486,7 +1486,7 @@ public void SerializeMemberAbsolute_InvokeIComponentWithoutSite_Success() var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1499,7 +1499,7 @@ public void SerializeMemberAbsolute_InvokeIComponentWithoutSite_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1512,7 +1512,7 @@ public void SerializeMemberAbsolute_InvokeIComponentWithoutSite_Success() info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches("^object_........_...._...._...._............$", nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1549,7 +1549,7 @@ public void SerializeMemberAbsolute_InvokeIComponentWithISite_Success(string nam var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1563,7 +1563,7 @@ public void SerializeMemberAbsolute_InvokeIComponentWithISite_Success(string nam info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1577,7 +1577,7 @@ public void SerializeMemberAbsolute_InvokeIComponentWithISite_Success(string nam info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); Assert.Null(info.GetValue("State", typeof(Hashtable))); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1624,7 +1624,7 @@ public void SerializeMemberAbsolute_InvokeIComponentWithINestedSite_Success(stri var info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - string nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + string nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1637,7 +1637,7 @@ public void SerializeMemberAbsolute_InvokeIComponentWithINestedSite_Success(stri info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable))); @@ -1650,7 +1650,7 @@ public void SerializeMemberAbsolute_InvokeIComponentWithINestedSite_Success(stri info = new SerializationInfo(store.GetType(), new FormatterConverter()); serializable.GetObjectData(info, new StreamingContext()); - nameResult = Assert.IsType(Assert.Single(Assert.IsType(info.GetValue("Names", typeof(ArrayList))))); + nameResult = Assert.IsType(Assert.Single(Assert.IsType>(info.GetValue("Names", typeof(List))))); Assert.Matches(expectedPattern, nameResult); Assert.Null(info.GetValue("Assemblies", typeof(AssemblyName[]))); Assert.Null(info.GetValue("Resources", typeof(Hashtable)));