public void EqualsWithNullTest() { 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.IsFalse(service.Equals(null)); }
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 EqualsWithDifferentObjectTest() { 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); string other = "name"; Assert.IsFalse(service.Equals(other)); Assert.IsFalse(service.GetHashCode() == other.GetHashCode()); }