Update docs. Add UnitTests.

This commit is contained in:
Christian Kratky
2019-10-03 15:23:35 +02:00
parent 9302e80d73
commit 073cd5243f
5 changed files with 84 additions and 17 deletions
@@ -13,5 +13,31 @@ namespace MQTTnet.Packets
public string Name { get; }
public string Value { get; }
public override int GetHashCode()
{
return Name.GetHashCode() ^ Value.GetHashCode();
}
public override bool Equals(object other)
{
return Equals(other as MqttUserProperty);
}
public bool Equals(MqttUserProperty other)
{
if (other == null)
{
return false;
}
if (ReferenceEquals(other, this))
{
return true;
}
return string.Equals(Name, other.Name, StringComparison.Ordinal) &&
string.Equals(Value, other.Value, StringComparison.Ordinal);
}
}
}