public void TestIEquatableInterface() { Stop stop1 = new Stop { StopID = 1 }; Stop stop2 = new Stop { StopID = 1 }; bool isEqual = stop1.Equals(stop2); stop2.StopID = 2; isEqual = stop1.Equals(stop2); }
public void CheckThatTwoObjectsAreSame() { _sut1.Id = TEXT_VALUE; _sut2.Id = TEXT_VALUE; _sut1.Code = TEXT_VALUE; _sut2.Code = TEXT_VALUE; _sut1.Name = TEXT_VALUE; _sut2.Name = TEXT_VALUE; _sut1.Description = TEXT_VALUE; _sut2.Description = TEXT_VALUE; _sut1.Latitude = DOUBLE_VALUE; _sut2.Latitude = DOUBLE_VALUE; _sut1.Longitude = DOUBLE_VALUE; _sut2.Longitude = DOUBLE_VALUE; _sut1.Zone = TEXT_VALUE; _sut2.Zone = TEXT_VALUE; _sut1.Url = TEXT_VALUE; _sut2.Url = TEXT_VALUE; _sut1.LocationType = LOCATION_TYPE; _sut2.LocationType = LOCATION_TYPE; _sut1.ParentStation = TEXT_VALUE; _sut2.ParentStation = TEXT_VALUE; _sut1.Timezone = TEXT_VALUE; _sut2.Timezone = TEXT_VALUE; _sut1.WheelchairBoarding = TEXT_VALUE; _sut2.WheelchairBoarding = TEXT_VALUE; Assert.True(_sut1.Equals(_sut1, _sut2)); }
/// <summary> /// Indicates whether the current Object is equal to another Object of the same type. /// </summary> /// <param name="other">An Object to compare with this Object.</param> /// <returns> /// true if the current Object is equal to the <paramref name="other" /> parameter; otherwise, false. /// </returns> public Boolean Equals(TextRange other) { if (ReferenceEquals(other, null)) { return(false); } if (ReferenceEquals(other, this)) { return(true); } return(Start.Equals(other.Start) && Stop.Equals(other.Stop) && TextDocument.Equals(other.TextDocument)); }
/// <summary> /// Returns true if BranchImplpermissions instances are equal /// </summary> /// <param name="other">Instance of BranchImplpermissions to be compared</param> /// <returns>Boolean</returns> public bool Equals(BranchImplpermissions other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Create == other.Create || Create != null && Create.Equals(other.Create) ) && ( Read == other.Read || Read != null && Read.Equals(other.Read) ) && ( Start == other.Start || Start != null && Start.Equals(other.Start) ) && ( Stop == other.Stop || Stop != null && Stop.Equals(other.Stop) ) && ( Class == other.Class || Class != null && Class.Equals(other.Class) )); }
public bool Equals(Line2D other) { return(Start.Equals(other.Start) && Stop.Equals(other.Stop)); }