コード例 #1
0
        public void DefaultValues()
        {
            var sut = new GotoStatement();

            Assert.AreEqual("", sut.Label);
            Assert.AreNotEqual(0, sut.GetHashCode());
            Assert.AreNotEqual(1, sut.GetHashCode());
        }
コード例 #2
0
        public void Equality_Default()
        {
            var a = new GotoStatement();
            var b = new GotoStatement();

            Assert.AreEqual(a, b);
            Assert.AreEqual(a.GetHashCode(), b.GetHashCode());
        }
コード例 #3
0
        public void Equality_DifferentLabel()
        {
            var a = new GotoStatement {
                Label = "a"
            };
            var b = new GotoStatement {
                Label = "b"
            };

            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode());
        }
コード例 #4
0
        public void Equality_ReallyTheSame()
        {
            var a = new GotoStatement {
                Label = "a"
            };
            var b = new GotoStatement {
                Label = "a"
            };

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