예제 #1
0
        public void DefaultValues()
        {
            var sut = new CaseBlock();

            Assert.AreEqual(new UnknownExpression(), sut.Label);
            Assert.AreEqual(Lists.NewList <IStatement>(), sut.Body);
            Assert.AreNotEqual(0, sut.GetHashCode());
            Assert.AreNotEqual(1, sut.GetHashCode());
        }
예제 #2
0
        public void Equality_Default()
        {
            var a = new CaseBlock();
            var b = new CaseBlock();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
예제 #3
0
        public void Equality_DifferentBody()
        {
            var a = new CaseBlock {
                Body = { new ReturnStatement() }
            };
            var b = new CaseBlock();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
예제 #4
0
        public void Equality_DifferentLabel()
        {
            var a = new CaseBlock {
                Label = Label("a")
            };
            var b = new CaseBlock();

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
예제 #5
0
        public void Equality_ReallyTheSame()
        {
            var a = new CaseBlock
            {
                Label = Label("a"),
                Body  = { new ReturnStatement() }
            };
            var b = new CaseBlock
            {
                Label = Label("a"),
                Body  = { new ReturnStatement() }
            };

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