public void Equals_NotEqual_DiffTypes() { InstanceInfo info1 = new InstanceInfo() { InstanceId = "foobar" }; Assert.False(info1.Equals(this)); }
/// <summary> /// Determines whether the specified <see cref="System.Object" /> is equal to this instance. /// </summary> /// <param name="obj">The object to compare with the current object.</param> /// <returns><c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.</returns> /// <inheritdoc /> public override bool Equals(object obj) { var o = obj as ComponentInfo; if (o == null) { return(false); } return(ComponentType.Equals(o.ComponentType)); }
public void Equals_Equals() { InstanceInfo info1 = new InstanceInfo() { InstanceId = "foobar" }; InstanceInfo info2 = new InstanceInfo() { InstanceId = "foobar" }; Assert.True(info1.Equals(info2)); }
public void Equals_NotEqual() { InstanceInfo info1 = new InstanceInfo() { InstanceId = "foobar" }; InstanceInfo info2 = new InstanceInfo() { InstanceId = "foobar2" }; Assert.False(info1.Equals(info2)); }