Esempio n. 1
0
        public void EqualityHasValueSemantics()
        {
            Assert.IsTrue(_falseBool.Equals(_falseBool));
            Assert.IsTrue(_falseBool == _falseBool);

            Assert.IsTrue(_falseBool.Equals(_false2Bool));
            Assert.IsTrue(_falseBool == _false2Bool);

            Assert.IsFalse(_falseBool.Equals(_trueBool));
            Assert.IsTrue(_falseBool != _trueBool);
        }
Esempio n. 2
0
        public void Equals()
        {
            Bool boolTrue  = true;
            Bool boolFalse = false;

            Assert.True(boolTrue.Equals(boolTrue));
            Assert.False(boolTrue.Equals(boolFalse));
            Assert.True(boolTrue == boolTrue);
            Assert.False(boolTrue == boolFalse);
            Assert.False(boolTrue != boolTrue);
            Assert.True(boolTrue != boolFalse);
            Assert.Equal(true.GetHashCode(), boolTrue.GetHashCode());
            Assert.Equal(false.GetHashCode(), boolFalse.GetHashCode());
        }
Esempio n. 3
0
        public void EqualsTest3()
        {
            var exp1 = new Bool(true);
            var exp2 = new Number(2);

            Assert.False(exp1.Equals(exp2));
        }
Esempio n. 4
0
        public void EqualsTest2()
        {
            var exp1 = new Bool(true);
            var exp2 = new Bool(true);

            Assert.True(exp1.Equals(exp2));
        }
Esempio n. 5
0
        public void EqualsTest()
        {
            var exp1 = new Bool(false);
            var exp2 = new Bool(true);

            Assert.False(exp1.Equals(exp2));
        }
 protected bool Equals(BasicTypes other)
 {
     return(Bool.Equals(other.Bool) && Byte == other.Byte && Character == other.Character &&
            Decimal == other.Decimal && Double.Equals(other.Double) && Float.Equals(other.Float) &&
            Int == other.Int && Long == other.Long && SByte == other.SByte && Short == other.Short &&
            string.Equals(String, other.String) && UInt == other.UInt && UShort == other.UShort &&
            ULong == other.ULong);
 }
Esempio n. 7
0
        static bool EvaluateInternal(CompiledRoute compiledRoute, IMessage message)
        {
            try
            {
                Bool evaluation = compiledRoute.Evaluate(message);

                if (evaluation.Equals(Bool.Undefined))
                {
                    Routing.UserAnalyticsLogger.LogUndefinedRouteEvaluation(message, compiledRoute.Route);
                }

                return(evaluation);
            }
            catch (Exception ex)
            {
                Events.EvaluateFailure(compiledRoute.Route, ex);
                throw;
            }
        }
Esempio n. 8
0
        protected bool Equals(CompositeType other)
        {
            if (!List.EmptyIfNull().SequenceEqual(other.List.EmptyIfNull()))
            {
                return(false);
            }

            if (!Inner.EmptyIfNull().SequenceEqual(other.Inner.EmptyIfNull()))
            {
                return(false);
            }

            return(Int == other.Int && Double == other.Double && DateTime.Equals(other.DateTime) && Bool.Equals(other.Bool));
        }