public void HashCode_NotEqualForDifferentKeys() { var key1 = new DocumentKey(new Dictionary<IFieldMappingInfo, object> { { new FakeFieldMappingInfo { FieldName = "id1" }, "**mykey**" } }); var key2 = new DocumentKey(new Dictionary<IFieldMappingInfo, object> { { new FakeFieldMappingInfo { FieldName = "id2" }, "**mykey**" } }); Assert.That(key1.GetHashCode(), Is.Not.EqualTo(key2.GetHashCode())); }
public void HashCode_NullSafe() { var key = new DocumentKey(new Dictionary<IFieldMappingInfo, object> { { new FakeFieldMappingInfo { FieldName = "id1" }, null } }); TestDelegate call = () => key.GetHashCode(); Assert.That(call, Throws.Nothing); }