예제 #1
0
        public void EqualsReturnTrueWhenCallsWithSameValueObject()
        {
            PropertyName sameValue = new PropertyName(Exp.Namespace + "SomeName");

            Assert.True(basicValue == sameValue);
            Assert.True(basicValue.Equals(sameValue));
        }
        /// <summary>
        /// Returns true if ComDayCqDamCoreImplJmxAssetIndexUpdateMonitorProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComDayCqDamCoreImplJmxAssetIndexUpdateMonitorProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComDayCqDamCoreImplJmxAssetIndexUpdateMonitorProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     JmxObjectname == other.JmxObjectname ||
                     JmxObjectname != null &&
                     JmxObjectname.Equals(other.JmxObjectname)
                     ) &&
                 (
                     PropertyMeasureEnabled == other.PropertyMeasureEnabled ||
                     PropertyMeasureEnabled != null &&
                     PropertyMeasureEnabled.Equals(other.PropertyMeasureEnabled)
                 ) &&
                 (
                     PropertyName == other.PropertyName ||
                     PropertyName != null &&
                     PropertyName.Equals(other.PropertyName)
                 ) &&
                 (
                     PropertyMaxWaitMs == other.PropertyMaxWaitMs ||
                     PropertyMaxWaitMs != null &&
                     PropertyMaxWaitMs.Equals(other.PropertyMaxWaitMs)
                 ) &&
                 (
                     PropertyMaxRate == other.PropertyMaxRate ||
                     PropertyMaxRate != null &&
                     PropertyMaxRate.Equals(other.PropertyMaxRate)
                 ) &&
                 (
                     FulltextMeasureEnabled == other.FulltextMeasureEnabled ||
                     FulltextMeasureEnabled != null &&
                     FulltextMeasureEnabled.Equals(other.FulltextMeasureEnabled)
                 ) &&
                 (
                     FulltextName == other.FulltextName ||
                     FulltextName != null &&
                     FulltextName.Equals(other.FulltextName)
                 ) &&
                 (
                     FulltextMaxWaitMs == other.FulltextMaxWaitMs ||
                     FulltextMaxWaitMs != null &&
                     FulltextMaxWaitMs.Equals(other.FulltextMaxWaitMs)
                 ) &&
                 (
                     FulltextMaxRate == other.FulltextMaxRate ||
                     FulltextMaxRate != null &&
                     FulltextMaxRate.Equals(other.FulltextMaxRate)
                 ));
        }
예제 #3
0
 public void Update(TComponentModelItem item)
 {
     if (item.NotNull())
     {
         if (PropertyName.Equals("ColumnWidth", StringComparison.InvariantCulture))
         {
             //PropertyValue = item.SettingsModel.ColumnWidth;
         }
     }
 }
예제 #4
0
        public override bool Equals(object obj)
        {
            CompositeProperty other = obj as CompositeProperty;

            if (other == null)
            {
                return(false);
            }
            return(ParentClassName.Equals(other.ParentClassName) &&
                   PropertyName.Equals(other.PropertyName) &&
                   Type.Equals(other.Type) &&
                   FieldName.Equals(other.FieldName));
        }
예제 #5
0
        public override bool Equals(object obj)
        {
            var another = obj as ObjectPropertyValidationDetails;

            if (another == null)
            {
                return(false);
            }

            return(ObjectType == another.ObjectType &&
                   ObjectId == another.ObjectId &&
                   PropertyName.Equals(another.PropertyName, StringComparison.InvariantCulture));
        }
예제 #6
0
        private void UpdateValue()
        {
            if (!PropertyName.Equals(string.Empty))
            {
                try
                {
                    expressionEvaluator.Variables["obj"]   = AssociatedObject;
                    expressionEvaluator.Variables["value"] = Value;;

                    expressionEvaluator.Evaluate($"obj.{PropertyName} = value");
                }
                catch { }
            }
        }
예제 #7
0
        public override bool EqualsNode(
            ExprNode node,
            bool ignoreStreamPrefix)
        {
            if (this == node) {
                return true;
            }

            if (node == null || GetType() != node.GetType()) {
                return false;
            }

            var that = (ExprContextPropertyNodeImpl) node;
            return PropertyName.Equals(that.PropertyName);
        }
예제 #8
0
        /// <summary>
        /// Returns true if APIError instances are equal
        /// </summary>
        /// <param name="other">Instance of APIError to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(APIError other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Category == other.Category ||
                     Category != null &&
                     Category.Equals(other.Category)
                     ) &&
                 (
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                 ) &&
                 (
                     HttpStatusCode == other.HttpStatusCode ||
                     HttpStatusCode != null &&
                     HttpStatusCode.Equals(other.HttpStatusCode)
                 ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Message == other.Message ||
                     Message != null &&
                     Message.Equals(other.Message)
                 ) &&
                 (
                     PropertyName == other.PropertyName ||
                     PropertyName != null &&
                     PropertyName.Equals(other.PropertyName)
                 ) &&
                 (
                     RequestId == other.RequestId ||
                     RequestId != null &&
                     RequestId.Equals(other.RequestId)
                 ));
        }
 public bool Equals(PropertyExtractor other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     if (other.GetType() != GetType())
     {
         return(false);
     }
     return(ExtractionMode == other.ExtractionMode && PropertyName.Equals(other.PropertyName));
 }
        private void OnTriggerEvent(object source, EventArgs args)
        {
            if (!PropertyName.Equals(string.Empty))
            {
                try
                {
                    expressionEvaluator.Variables["obj"] = AssociatedObject;

                    object result = expressionEvaluator.Evaluate($"obj.{PropertyName}");

                    if (!result.Equals(Value))
                    {
                        Value = result;
                    }
                }
                catch { }
            }
        }
        private void UpdateValue()
        {
            if (UpdateViewFromViewModel && AssociatedObject != null && !PropertyName.Equals(string.Empty))
            {
                try
                {
                    expressionEvaluator.Variables["obj"] = AssociatedObject;
                    object result = expressionEvaluator.Evaluate($"obj.{PropertyName}");

                    if (!result.Equals(Value))
                    {
                        expressionEvaluator.Variables["value"] = Value;

                        expressionEvaluator.Evaluate($"obj.{PropertyName} = value");
                    }
                }
                catch
                { }
            }
        }
        public void ImplementsEqualsCorrectly(PropertyName first, object other, bool expected, string reason)
        {
            _outputHelper.WriteLine($"First instance : {first}");
            _outputHelper.WriteLine($"Second instance : {other}");

            // Act
            bool actual         = first.Equals(other);
            int  actualHashCode = first.GetHashCode();

            // Assert
            actual.Should()
            .Be(expected, reason);
            if (expected)
            {
                actualHashCode.Should()
                .Be(other?.GetHashCode(), reason);
            }
            else
            {
                actualHashCode.Should()
                .NotBe(other?.GetHashCode(), reason);
            }
        }
 public virtual bool IsMatch(string propertyKey, ParameterInfo parameterInfo, MemberInfo member,
                             IApplication httpApp, IHttpRequest request)
 {
     return(PropertyName.Equals(propertyKey, MatchQualification));
 }
 /// <summary>
 /// Determines whether PropertyName of the this instance and another specified object have the same string value.
 /// </summary>
 /// <typeparam name="TEntity">The type of the entity (interface or class).</typeparam>
 /// <param name="expression">The expression returning the entity property, in the form x =&gt; x.Id</param>
 /// <returns>true or false</returns>
 public bool PropertyNameEquals <TEntity>(Expression <Func <TEntity, object> > expression)
 {
     return(PropertyName.Equals(PropertyHelper.Name(expression)));
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(PropertyMapBuilder other)
 {
     return(other != null && PropertyName.Equals(other.PropertyName, StringComparison.InvariantCultureIgnoreCase));
 }