public void GetHashCode_should_should_ignored_inherited_marked_properties()
        {
            var instance = new InheritedIgnoredPropertiesClass();

            instance.X = 1;
            instance.Y = 2;

            var firstResult = instance.GetHashCode();

            instance.Y = 3;
            var secondResult = instance.GetHashCode();

            Assert.Equal(firstResult, secondResult);
        }
コード例 #2
0
        public void Equals_should_should_inherited_ignored_marked_properties()
        {
            var first = new InheritedIgnoredPropertiesClass();

            first.X = 1;
            first.Y = 2;

            var second = new InheritedIgnoredPropertiesClass();

            second.X = 1;
            second.Y = 3;

            var result = first.Equals(second);

            Assert.True(result);
        }