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

            Assert.AreEqual(new UnknownExpression(), sut.Expression);
            Assert.False(sut.IsVoid);
            Assert.AreNotEqual(0, sut.GetHashCode());
            Assert.AreNotEqual(1, sut.GetHashCode());
        }
Beispiel #2
0
        public void Equality_default()
        {
            var a = new ReturnStatement();
            var b = new ReturnStatement();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
Beispiel #3
0
        public void Equality_differentKind()
        {
            var a = new ReturnStatement {
                IsVoid = true
            };
            var b = new ReturnStatement();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Beispiel #4
0
        public void Equality_differentExpression()
        {
            var a = new ReturnStatement {
                Expression = new ConstantValueExpression()
            };
            var b = new ReturnStatement {
                Expression = new NullExpression()
            };

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
Beispiel #5
0
        public void Equality_reallyTheSame()
        {
            var a = new ReturnStatement
            {
                Expression = new ConstantValueExpression(),
                IsVoid     = true
            };
            var b = new ReturnStatement
            {
                Expression = new ConstantValueExpression(),
                IsVoid     = true
            };

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