public void EqualsReturnTrueWhenCallsWithSameValueObject() { ParameterName sameValue = new ParameterName(Exp.Namespace + "SomeName"); Assert.True(basicValue == sameValue); Assert.True(basicValue.Equals(sameValue)); }
/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <returns> /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false. /// </returns> /// <param name="other">An object to compare with this object.</param> public Boolean Equals(ActualParameterElement other) { return(EqualityHelper.IsNullOrReferenceEqual(other, this) ?? ParameterName.Equals(other.ParameterName) && Position.Equals(other.Position) && Equals(Value, other.Value)); }
public bool Equals(TypedParameterModel?other) { return(other != null && ParameterName.Equals(other.ParameterName) && (PrimitiveType != null ? PrimitiveType.Equals(other.PrimitiveType) && DefaultValue == other.DefaultValue : ComplexType !.Equals(other.ComplexType))); }
/// <summary> /// Reads the service API version value from a request. /// </summary> /// <param name="request">The <see cref="HttpRequestMessage">HTTP request</see> to read the API version from.</param> /// <returns>The raw, unparsed service API version value read from the request or <c>null</c> if request does not contain an API version.</returns> /// <exception cref="AmbiguousApiVersionException">Multiple, different API versions were requested.</exception> public virtual string Read(HttpRequestMessage request) { Arg.NotNull(request, nameof(request)); var parameters = from pair in request.GetQueryNameValuePairs() where ParameterName.Equals(pair.Key, OrdinalIgnoreCase) && pair.Value.Length > 0 select pair.Value; var versions = new HashSet <string>(parameters, StringComparer.OrdinalIgnoreCase); return(versions.EnsureZeroOrOneApiVersions()); }
public override bool Equals(object obj) { if (ReferenceEquals(this, obj)) { return(true); } if (obj is null || GetType() != obj.GetType()) { return(false); } var other = (QueryStringParameterScopeExpression)obj; return(ParameterName.Equals(other.ParameterName) && Equals(Scope, other.Scope)); }
public override bool Equals(object obj) { if (ReferenceEquals(this, obj)) { return(true); } var other = obj as LambdaExpression; if ( other == null || !ParameterName.Equals(other.ParameterName, StringComparison.Ordinal) || !Body.Equals(other.Body) ) { return(false); } return(true); }
public override bool Resolve(IWorkflowContext context) { if (string.IsNullOrEmpty(ParameterName)) { throw new ArgumentNullException("ParameterName"); } bool result = false; object obj1 = null; if (ParameterName.Equals("$User.RoleName$")) { obj1 = string.Join("|", context.FlowInstance.Creator.Roles.Select(o => o.RoleType.Name)); } else { if (!Env.TryResolve(ParameterName, out obj1)) { if (context.Parameter != null && context.Parameter.Count > 0 && context.Parameter.Keys.Contains(ParameterName, StringComparer.Create(Thread.CurrentThread.CurrentCulture, true))) { obj1 = context.Parameter[ParameterName]; } } } var op = AllColumnOperator.OperatorMapping[Operator]; object obj2 = ParameterValue; if (ParameterValue.IsNotNullOrEmpty() && Env.TryResolve(ParameterValue, out obj2)) { result = op.Operate(obj1, obj2); } else { result = op.Operate(obj1, ParameterValue); } Log("{6}:参数名【{0}】解析为:{1},参数值【{2}】解析为:{3},运算符:{4},结果:{5}".FormatTo(ParameterName, obj1, ParameterValue, obj2, op.GetType().GetDisplayName(), result, context.FlowInstance.Id)); return(result); }
/// <summary> /// Checks if this instance properties equals the specified other option. /// </summary> /// <param name="other">The other option.</param> /// <returns></returns> public bool Equals(CommandlineOption other) { return(Name.Equals(other.Name) && LongName.Equals(other.LongName) && Description.Equals(other.Description) && Flags == other.Flags && ParameterName.Equals(other.ParameterName) && RequiredPosition.Equals(other.RequiredPosition)); }
internal bool IsDashQuestion() { return(ParameterNameSpecified && (ParameterName.Equals("?", StringComparison.OrdinalIgnoreCase))); }
public bool Equals(FakeDbDataParameter other) { return(ParameterName.Equals(other.ParameterName)); }