Ejemplo n.º 1
0
        public void Equals()
        {
            TextValue v1 = new TextValue("Hello World");
            TextValue v2 = new TextValue("hELLO wORLD");

            Assert.IsTrue(v1.Equals(v2));
            Assert.IsFalse(v1.Equals(new TextValue("Hello Worl")));
        }
Ejemplo n.º 2
0
        public void EqualsTest1()
        {
            TextValue target   = new TextValue("my value");
            TextValue operand  = new TextValue("my value");
            bool      expected = true;
            bool      actual;

            actual = target.Equals(operand);
            Assert.AreEqual(expected, actual);

            operand  = new TextValue("my other value");
            expected = false;
            actual   = target.Equals(operand);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void UnansEquals3()
        {
            TextValue uv1 = new TextValue();
            TextValue uv2 = new TextValue();

            uv1.Equals(uv2);
        }
Ejemplo n.º 4
0
        public void UnansEquals2()
        {
            TextValue v  = new TextValue("Hello World");
            TextValue uv = new TextValue();

            v.Equals(uv);
        }
Ejemplo n.º 5
0
        public void UnansEquals1()
        {
            TextValue v  = new TextValue("Hello World");
            TextValue uv = new TextValue();

            uv.Equals(v);
        }
Ejemplo n.º 6
0
        public bool Equals(OpportunityDetail other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DetailId == other.DetailId ||
                     DetailId != null &&
                     DetailId.Equals(other.DetailId)
                     ) &&
                 (
                     TextValue == other.TextValue ||
                     TextValue != null &&
                     TextValue.Equals(other.TextValue)
                 ) &&
                 (
                     DttmValue == other.DttmValue ||
                     DttmValue != null &&
                     DttmValue.Equals(other.DttmValue)
                 ) &&
                 (
                     IntValue == other.IntValue ||
                     IntValue != null &&
                     IntValue.Equals(other.IntValue)
                 ));
        }
        public override bool Equals(object o)
        {
            if (this == o)
            {
                return(true);
            }

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

            var that = (FilledAutofillField)o;

            if (TextValue != null ? !TextValue.Equals(that.TextValue) : that.TextValue != null)
            {
                return(false);
            }
            if (DateValue != null ? !DateValue.Equals(that.DateValue) : that.DateValue != null)
            {
                return(false);
            }

            return(ToggleValue != null?ToggleValue.Equals(that.ToggleValue) : that.ToggleValue == null);
        }
Ejemplo n.º 8
0
        public void EqualsTest()
        {
            TextValue target   = new TextValue("Test");
            object    obj      = "Test";     // string
            bool      expected = false;      // we expect them not to be equal because they are not the same type.
            // Implicit conversion from string to TextValue does not take effect here.
            // However, even if it did, that might be fine too... this test is just asserting the expected (but not required) behavior.
            bool actual;

            actual = target.Equals(obj);
            Assert.AreEqual(expected, actual);

            obj      = new TextValue("Test");
            expected = true;
            actual   = target.Equals(obj);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 9
0
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

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

            var other = (MatchTextExpression)obj;

            return(TargetAttribute.Equals(other.TargetAttribute) && TextValue.Equals(other.TextValue) && MatchKind == other.MatchKind);
        }
Ejemplo n.º 10
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            FilledAutofillField that = (FilledAutofillField)obj;

            if (!TextValue?.Equals(that.TextValue) ?? that.TextValue != null)
            {
                return(false);
            }
            if (DateValue != null ? !DateValue.Equals(that.DateValue) : that.DateValue != null)
            {
                return(false);
            }
            return(ToggleValue != null?ToggleValue.Equals(that.ToggleValue) : that.ToggleValue == null);
        }