Fix equality of messages to include unknown fields
diff --git a/src/ProtocolBuffers/AbstractMessage.cs b/src/ProtocolBuffers/AbstractMessage.cs
index 11bb948..27cd77b 100644
--- a/src/ProtocolBuffers/AbstractMessage.cs
+++ b/src/ProtocolBuffers/AbstractMessage.cs
@@ -213,13 +213,14 @@
if (otherMessage == null || otherMessage.DescriptorForType != DescriptorForType) {
return false;
}
- return Dictionaries.Equals(AllFields, otherMessage.AllFields);
+ return Dictionaries.Equals(AllFields, otherMessage.AllFields) && UnknownFields.Equals(otherMessage.UnknownFields);
}
public override int GetHashCode() {
int hash = 41;
hash = (19 * hash) + DescriptorForType.GetHashCode();
hash = (53 * hash) + Dictionaries.GetHashCode(AllFields);
+ hash = (29 * hash) + UnknownFields.GetHashCode();
return hash;
}
}