internal void EqualsTest(SessionId sessionId1, object obj, bool expected) { if (obj is SessionId sessionId2) { sessionId1.Equals(sessionId2).Should().Be(expected); (sessionId1 == sessionId2).Should().Be(expected); (sessionId1 != sessionId2).Should().Be(!expected); sessionId1.GetHashCode().Equals(sessionId2.GetHashCode()).Should().Be(expected); } sessionId1.Equals(obj).Should().Be(expected); }
public void Can_compare_with_guids() { var value = Guid.NewGuid(); var sessionId1 = new SessionId(value, true); var sessionId2 = new SessionId(Guid.NewGuid(), false); Assert.True(sessionId1.Equals(value)); Assert.False(sessionId2.Equals(value)); }
/// <summary> /// Returns true if DocuViewareSaveParameters instances are equal /// </summary> /// <param name="input">Instance of DocuViewareSaveParameters to be compared</param> /// <returns>Boolean</returns> public bool Equals(DocuViewareSaveParameters input) { if (input == null) { return(false); } return (( SessionId == input.SessionId || (SessionId != null && SessionId.Equals(input.SessionId)) ) && ( ControlId == input.ControlId || (ControlId != null && ControlId.Equals(input.ControlId)) ) && ( FileName == input.FileName || (FileName != null && FileName.Equals(input.FileName)) ) && ( Format == input.Format || (Format != null && Format.Equals(input.Format)) ) && ( PageRange == input.PageRange || (PageRange != null && PageRange.Equals(input.PageRange)) )); }
public bool Equals(SessionContext other) { if (other == null) { return(false); } return(SessionId.Equals(other.SessionId)); }
/// <summary> /// Compares two charge detail records for equality. /// </summary> /// <param name="ChargeDetailRecord">A charge detail record to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public Boolean Equals(ChargeDetailRecord ChargeDetailRecord) { if ((Object)ChargeDetailRecord == null) { return(false); } return(SessionId.Equals(ChargeDetailRecord.SessionId)); }
public override bool Equals(object obj) { var model = obj as BasketItemModel; return(model != null && SessionId.Equals(model.SessionId) && ProductId.Equals(model.ProductId) && Quantity == model.Quantity); }
public override bool Equals(object obj) { var ec = obj as SessionCollection; if (ec == null) { return(false); } return(SessionId.Equals(ec.SessionId)); }
public bool Equals(TempSaleDTO other) { return(other != null ? CustomerName.Equals(other.CustomerName) && ManagerName.Equals(other.ManagerName) && ProductName.Equals(other.ProductName) && SaleDate.Equals(other.SaleDate) && SessionId.Equals(other.SessionId) && Total.Equals(other.Total) && Id.Equals(other.Id) : false); }
/// <summary> /// Determines if the current object is equal to the <paramref name="obj"/> /// </summary> /// <param name="obj">The object to compare</param> /// <returns>true, if the two instances are equal</returns> public override bool Equals(object obj) { if (!(obj is ProfilerEvent)) { return(false); } ProfilerEvent other = (ProfilerEvent)obj; return(Type.Equals(other.Type) && SessionId.Equals(other.SessionId) && ObjectType.Equals(other.ObjectType) && ObjectId.Equals(other.ObjectId) && LineNumber.Equals(other.LineNumber) && StatementName.Equals(other.StatementName) && TimeStampRelativeMSec.Equals(other.TimeStampRelativeMSec)); }
/// <summary> /// Compares two authorize remote stop requests for equality. /// </summary> /// <param name="AuthorizeRemoteStopRequest">An authorize remote stop request to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public override Boolean Equals(AuthorizeRemoteStopRequest AuthorizeRemoteStopRequest) { if (AuthorizeRemoteStopRequest is null) { return(false); } return(SessionId.Equals(AuthorizeRemoteStopRequest.SessionId) && ProviderId.Equals(AuthorizeRemoteStopRequest.ProviderId) && EVSEId.Equals(AuthorizeRemoteStopRequest.EVSEId) && ((!CPOPartnerSessionId.HasValue && !AuthorizeRemoteStopRequest.CPOPartnerSessionId.HasValue) || (CPOPartnerSessionId.HasValue && AuthorizeRemoteStopRequest.CPOPartnerSessionId.HasValue && CPOPartnerSessionId.Value.Equals(AuthorizeRemoteStopRequest.CPOPartnerSessionId.Value))) && ((!EMPPartnerSessionId.HasValue && !AuthorizeRemoteStopRequest.EMPPartnerSessionId.HasValue) || (EMPPartnerSessionId.HasValue && AuthorizeRemoteStopRequest.EMPPartnerSessionId.HasValue && EMPPartnerSessionId.Value.Equals(AuthorizeRemoteStopRequest.EMPPartnerSessionId.Value)))); }
private Select GetItemAudienceSelect() { var select = new Select(UserConnection) .Column("Id") .From(CampaignParticipantTable) .Where(CampaignParticipantTable, "CampaignId").IsEqual(Column.Parameter(CampaignId)) .And(CampaignParticipantTable, "CampaignItemId").IsEqual(Column.Parameter(CampaignItemId)) .And(CampaignParticipantTable, "StatusId") .IsEqual(Column.Parameter(CampaignConstants.CampaignParticipantParticipatingStatusId)) .And(CampaignParticipantTable, "StepCompleted").IsEqual(Column.Const(false)) as Select; if (!SessionId.Equals(default(Guid))) { select.And(CampaignParticipantTable, "SessionId").IsEqual(Column.Parameter(SessionId)); } select.SpecifyNoLockHints(); return(select); }
/// <summary> /// Returns base query for <see cref="SequenceFlowElement"/> /// </summary> /// <param name="sourceRefUId">Unique identifier of the sequence's source element.</param> /// <param name="targetRefUId">Unique identifier of the sequence's target element.</param> /// <returns>Query with base logic of <see cref="SequenceFlowElement"/>.</returns> protected virtual Update GetSequenceFlowBaseUpdate(Guid sourceRefUId, Guid targetRefUId) { var result = new Update(UserConnection, CampaignParticipantTable) .Set("CampaignItemId", Column.Parameter(targetRefUId)) .Set("StepModifiedOn", Column.Parameter(DateTime.UtcNow)) .Set("StepCompletedOn", Column.Parameter(null, "DateTime")) .Set("StepCompleted", Column.Parameter(false)) .Where("StatusId").IsEqual(Column.Parameter(CampaignConstants.CampaignParticipantParticipatingStatusId)) .And("CampaignItemId") .IsEqual(Column.Parameter(sourceRefUId)) as Update; if (!SessionId.Equals(default(Guid))) { result.And(CampaignParticipantTable, "SessionId").IsEqual(Column.Parameter(SessionId)); } result.WithHints(new RowLockHint()); return(result); }
/// <summary> /// Compares two authorize stop requests for equality. /// </summary> /// <param name="AuthorizeStop">An authorize stop request to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public override Boolean Equals(AuthorizeStopRequest AuthorizeStop) { if (AuthorizeStop is null) { return(false); } return(OperatorId.Equals(AuthorizeStop.OperatorId) && SessionId.Equals(AuthorizeStop.SessionId) && Identification.Equals(AuthorizeStop.Identification) && ((!EVSEId.HasValue && !AuthorizeStop.EVSEId.HasValue) || (EVSEId.HasValue && AuthorizeStop.EVSEId.HasValue && EVSEId.Value.Equals(AuthorizeStop.EVSEId.Value))) && ((!CPOPartnerSessionId.HasValue && !AuthorizeStop.CPOPartnerSessionId.HasValue) || (CPOPartnerSessionId.HasValue && AuthorizeStop.CPOPartnerSessionId.HasValue && CPOPartnerSessionId.Value.Equals(AuthorizeStop.CPOPartnerSessionId.Value))) && ((!EMPPartnerSessionId.HasValue && !AuthorizeStop.EMPPartnerSessionId.HasValue) || (EMPPartnerSessionId.HasValue && AuthorizeStop.EMPPartnerSessionId.HasValue && EMPPartnerSessionId.Value.Equals(AuthorizeStop.EMPPartnerSessionId.Value)))); }
private void SetSubHost(SessionId hostSessionId) { Debug.Log("서브 호스트 세션 설정 진입"); // 누가 서브 호스트 세션인지 서버에서 보낸 정보값 확인 // 서버에서 보낸 SuperGamer 정보로 GameRecords의 SuperGamer 정보 갱신 foreach (var record in gameRecords) { if (record.Value.m_sessionId.Equals(hostSessionId)) { record.Value.m_isSuperGamer = true; } else { record.Value.m_isSuperGamer = false; } } // 내가 호스트 세션인지 확인 if (hostSessionId.Equals(Backend.Match.GetMySessionId())) { isHost = true; } else { isHost = false; } hostSession = hostSessionId; Debug.Log("서브 호스트 여부 : " + isHost); // 호스트 세션이면 로컬에서 처리하는 패킷이 있으므로 로컬 큐를 생성해준다 if (isHost) { localQueue = new Queue <KeyMessage>(); } else { localQueue = null; } Debug.Log("서브 호스트 설정 완료"); }
protected bool Equals(RelaySource other) { return(string.Equals(Name, other.Name) && SourceType == other.SourceType && SessionId.Equals(other.SessionId)); }
public bool Equals(ISession other) => other != null && SessionId.Equals(other.SessionId);
public override bool Equals(object obj) { Account account = obj as Account; if (account == null) { return(false); } if ((null == AccountName && null != account.AccountName) || (null != AccountName && !AccountName.Equals(account.AccountName, StringComparison.InvariantCultureIgnoreCase))) { return(false); } if ((null == SessionId && null != account.SessionId) || (null != SessionId && !SessionId.Equals(account.SessionId, StringComparison.InvariantCultureIgnoreCase))) { return(false); } IPEndPoint thisEndPoint = (IPEndPoint)EndPoint; IPEndPoint otherEndPoint = (IPEndPoint)account.EndPoint; return((null != EndPoint || null == account.EndPoint) && (null == EndPoint || thisEndPoint.Address.Equals(otherEndPoint.Address))); }
public void Objects_with_equal_values_are_equal() { var value = Guid.NewGuid(); var sessionId1 = new SessionId(value, true); var sessionId2 = new SessionId(value, false); Assert.True(sessionId1.Equals(sessionId2)); }