public void UniqueDeviceNameShouldBeEqual() { var guid = Guid.NewGuid(); var udn = new UniqueDeviceName { Uuid = guid }; var udn2 = new UniqueDeviceName { Uuid = new Guid(guid.ToByteArray()) }; Assert.IsTrue(udn.Equals(udn2)); Assert.IsTrue(udn2.Equals(udn)); Assert.IsTrue(udn2.GetHashCode() == udn.GetHashCode()); Assert.IsFalse(udn.Equals(null)); Assert.IsTrue(udn.Equals(udn)); Assert.IsFalse(udn.Equals("hello")); }
public override int GetHashCode() { return(UniqueDeviceName.GetHashCode()); }