Beispiel #1
0
        public static void EqualsTest(EditorBrowsableState state1, EditorBrowsableState state2, bool equal)
        {
            var attr1 = new EditorBrowsableAttribute(state1);
            var attr2 = new EditorBrowsableAttribute(state2);

            Assert.True(attr1.Equals(attr1));
            Assert.Equal(equal, attr1.Equals(attr2));
            Assert.Equal(equal, attr2.Equals(attr1));
            Assert.Equal(equal, attr1.GetHashCode().Equals(attr2.GetHashCode()));
        }
        public static void Equals(EditorBrowsableState state1, EditorBrowsableState state2, bool equal)
        {
            var attr1 = new EditorBrowsableAttribute(state1);
            var attr2 = new EditorBrowsableAttribute(state2);

            Assert.True(attr1.Equals(attr1));
            Assert.Equal(equal, attr1.Equals(attr2));
            Assert.Equal(equal, attr2.Equals(attr1));
            Assert.Equal(equal, attr1.GetHashCode().Equals(attr2.GetHashCode()));
        }
        public static void TestEqual()
        {
            var attr = new EditorBrowsableAttribute(EditorBrowsableState.Advanced);
            Assert.Equal(attr, attr);
            Assert.True(attr.Equals(attr));
            Assert.Equal(attr.GetHashCode(), attr.GetHashCode());

            Assert.Equal(new EditorBrowsableAttribute(EditorBrowsableState.Advanced), attr);
            Assert.Equal(new EditorBrowsableAttribute(EditorBrowsableState.Advanced).GetHashCode(), attr.GetHashCode());

            Assert.NotEqual(new EditorBrowsableAttribute(EditorBrowsableState.Always), attr);
            Assert.NotEqual(new EditorBrowsableAttribute(EditorBrowsableState.Never).GetHashCode(), attr.GetHashCode());
            Assert.False(attr.Equals(null));
        }
Beispiel #4
0
        public static void TestEqual()
        {
            var attr = new EditorBrowsableAttribute(EditorBrowsableState.Advanced);

            Assert.Equal(attr, attr);
            Assert.True(attr.Equals(attr));
            Assert.Equal(attr.GetHashCode(), attr.GetHashCode());

            Assert.Equal(new EditorBrowsableAttribute(EditorBrowsableState.Advanced), attr);
            Assert.Equal(new EditorBrowsableAttribute(EditorBrowsableState.Advanced).GetHashCode(), attr.GetHashCode());

            Assert.NotEqual(new EditorBrowsableAttribute(EditorBrowsableState.Always), attr);
            Assert.NotEqual(new EditorBrowsableAttribute(EditorBrowsableState.Never).GetHashCode(), attr.GetHashCode());
            Assert.False(attr.Equals(null));
        }