public void EqualsWithSelfTest() { string name = "name"; string hostname = "hostname"; ushort port = 8080; string type = "type"; Dictionary <string, string> TXTRecord = new Dictionary <string, string>() { { "key", "value" } }; SDService service = new SDService(name, hostname, port, type, TXTRecord); Assert.IsTrue(service.Equals(service)); Assert.IsTrue(service.GetHashCode() == service.GetHashCode()); }
public void EqualsWithNameNullTest() { string name = "name"; string hostname = "hostname"; ushort port = 8080; string type = "type"; Dictionary <string, string> TXTRecord = new Dictionary <string, string>() { { "key", "value" } }; SDService service = new SDService(null, hostname, port, type, TXTRecord); SDService other = new SDService(name, hostname, port, type, TXTRecord); Assert.IsFalse(service.Equals(other)); Assert.IsFalse(service.GetHashCode() == other.GetHashCode()); }