diff --git a/ValveKeyValue/ValveKeyValue.Test/ApiSurfaceTestCase.cs b/ValveKeyValue/ValveKeyValue.Test/ApiSurfaceTestCase.cs index 1ccbbe4e..0fa2f964 100644 --- a/ValveKeyValue/ValveKeyValue.Test/ApiSurfaceTestCase.cs +++ b/ValveKeyValue/ValveKeyValue.Test/ApiSurfaceTestCase.cs @@ -142,41 +142,55 @@ static bool IsHidingMember(MethodInfo method) return false; } - var baseMethod = baseType.GetMethod(method.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - if (baseMethod == null) - { - return false; - } + var baseMethods = baseType.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - if (baseMethod.DeclaringType == method.DeclaringType) + foreach (var baseMethod in baseMethods) { - return false; - } + if (baseMethod.Name != method.Name) + { + continue; + } - var methodDefinition = method.GetBaseDefinition(); - var baseMethodDefinition = baseMethod.GetBaseDefinition(); + if (baseMethod.DeclaringType == method.DeclaringType) + { + continue; + } - if (methodDefinition.DeclaringType == baseMethodDefinition.DeclaringType) - { - return false; - } + var methodDefinition = method.GetBaseDefinition(); + var baseMethodDefinition = baseMethod.GetBaseDefinition(); - var methodParameters = method.GetParameters(); - var baseMethodParameters = baseMethod.GetParameters(); - if (methodParameters.Length != baseMethodParameters.Length) - { - return false; - } + if (methodDefinition.DeclaringType == baseMethodDefinition.DeclaringType) + { + continue; + } - for (int i = 0; i < methodParameters.Length; i++) - { - if (methodParameters[i].ParameterType != baseMethodParameters[i].ParameterType) + var methodParameters = method.GetParameters(); + var baseMethodParameters = baseMethod.GetParameters(); + if (methodParameters.Length != baseMethodParameters.Length) { - return false; + continue; } + + var hasMatchingParameters = true; + + for (int i = 0; i < methodParameters.Length; i++) + { + if (methodParameters[i].ParameterType != baseMethodParameters[i].ParameterType) + { + hasMatchingParameters = false; + break; + } + } + + if (!hasMatchingParameters) + { + continue; + } + + return true; } - return true; + return false; } static string GetTypeAsString(Type type) diff --git a/ValveKeyValue/ValveKeyValue.Test/Test Data/apisurface.txt b/ValveKeyValue/ValveKeyValue.Test/Test Data/apisurface.txt index df664688..3f1f9e08 100644 --- a/ValveKeyValue/ValveKeyValue.Test/Test Data/apisurface.txt +++ b/ValveKeyValue/ValveKeyValue.Test/Test Data/apisurface.txt @@ -29,6 +29,79 @@ public class ValveKeyValue.KeyValueException public string ToString(); } +public class ValveKeyValue.KVArrayValue +{ + public void Add(ValveKeyValue.KVValue value); + public void AddRange(System.Collections.Generic.IEnumerable`1[[ValveKeyValue.KVValue]] values); + public void Clear(); + public bool Contains(ValveKeyValue.KVValue item); + public void CopyTo(ValveKeyValue.KVValue[] array, int arrayIndex); + public bool Equals(object obj); + protected void Finalize(); + public int get_Count(); + public bool get_IsReadOnly(); + public ValveKeyValue.KVValue get_Item(int key); + public ValveKeyValue.KVValue get_Item(string key); + public ValveKeyValue.KVValueType get_ValueType(); + public System.Collections.Generic.IEnumerator`1[[ValveKeyValue.KVValue]] GetEnumerator(); + public int GetHashCode(); + public Type GetType(); + public TypeCode GetTypeCode(); + public int IndexOf(ValveKeyValue.KVValue item); + public void Insert(int index, ValveKeyValue.KVValue item); + protected object MemberwiseClone(); + public bool Remove(ValveKeyValue.KVValue item); + public void RemoveAt(int index); + public void set_Item(int key, ValveKeyValue.KVValue value); + public bool ToBoolean(IFormatProvider provider); + public byte ToByte(IFormatProvider provider); + public char ToChar(IFormatProvider provider); + public DateTime ToDateTime(IFormatProvider provider); + public decimal ToDecimal(IFormatProvider provider); + public double ToDouble(IFormatProvider provider); + public short ToInt16(IFormatProvider provider); + public int ToInt32(IFormatProvider provider); + public long ToInt64(IFormatProvider provider); + public sbyte ToSByte(IFormatProvider provider); + public float ToSingle(IFormatProvider provider); + public string ToString(); + public string ToString(IFormatProvider provider); + public object ToType(Type conversionType, IFormatProvider provider); + public ushort ToUInt16(IFormatProvider provider); + public uint ToUInt32(IFormatProvider provider); + public ulong ToUInt64(IFormatProvider provider); +} + +public class ValveKeyValue.KVBinaryBlob +{ + public bool Equals(object obj); + protected void Finalize(); + public Memory`1[[byte]] get_Bytes(); + public ValveKeyValue.KVValue get_Item(string key); + public ValveKeyValue.KVValueType get_ValueType(); + public int GetHashCode(); + public Type GetType(); + public TypeCode GetTypeCode(); + protected object MemberwiseClone(); + public bool ToBoolean(IFormatProvider provider); + public byte ToByte(IFormatProvider provider); + public char ToChar(IFormatProvider provider); + public DateTime ToDateTime(IFormatProvider provider); + public decimal ToDecimal(IFormatProvider provider); + public double ToDouble(IFormatProvider provider); + public short ToInt16(IFormatProvider provider); + public int ToInt32(IFormatProvider provider); + public long ToInt64(IFormatProvider provider); + public sbyte ToSByte(IFormatProvider provider); + public float ToSingle(IFormatProvider provider); + public string ToString(); + public string ToString(IFormatProvider provider); + public object ToType(Type conversionType, IFormatProvider provider); + public ushort ToUInt16(IFormatProvider provider); + public uint ToUInt32(IFormatProvider provider); + public ulong ToUInt64(IFormatProvider provider); +} + public sealed class ValveKeyValue.KVIgnoreAttribute { public bool Equals(object obj);