Beispiel #1
0
        public void EqualsTest()
        {
            var s1 = new BindingScope("123");
            var s2 = new BindingScope("123");
            var s3 = new BindingScope("321");

            Assert.IsTrue(s1 == s2);
            Assert.IsTrue(s2 == s1);
            Assert.IsFalse(s1 == s3);

            Assert.IsFalse(s1 != s2);
            Assert.IsFalse(s2 != s1);
            Assert.IsTrue(s1 != s3);

            Assert.IsTrue(s1.Equals(s2));
            Assert.IsTrue(s1.Equals((object)s2));

            Assert.IsTrue(s1.Equals(s1));
            Assert.IsTrue(s1.Equals((object)s1));

            Assert.IsFalse(s1.Equals(null));
            Assert.IsFalse(s1.Equals((object)null));
            Assert.IsFalse(s1.Equals((object)s3));
            Assert.IsFalse(s1.Equals("123"));
        }