Beispiel #1
0
        public void DefaultValues()
        {
            var sut = new IfElseExpression();

            Assert.AreEqual(new UnknownExpression(), sut.Condition);
            Assert.AreEqual(new UnknownExpression(), sut.ThenExpression);
            Assert.AreEqual(new UnknownExpression(), sut.ElseExpression);
            Assert.AreNotEqual(0, sut.GetHashCode());
            Assert.AreNotEqual(1, sut.GetHashCode());
        }
Beispiel #2
0
        public void Equality_Default()
        {
            var a = new IfElseExpression();
            var b = new IfElseExpression();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Beispiel #3
0
        public void Equality_DifferentThen()
        {
            var a = new IfElseExpression {
                ThenExpression = new ConstantValueExpression()
            };
            var b = new IfElseExpression();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Beispiel #4
0
        public void Equality_ReallyTheSame()
        {
            var a = new IfElseExpression
            {
                Condition      = new ConstantValueExpression(),
                ThenExpression = new ConstantValueExpression(),
                ElseExpression = new ReferenceExpression()
            };
            var b = new IfElseExpression
            {
                Condition      = new ConstantValueExpression(),
                ThenExpression = new ConstantValueExpression(),
                ElseExpression = new ReferenceExpression()
            };

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }