Example #1
0
        public static PersonExWithIgnoreForSelf CreatePersonExWithIgnoreForSelf()
        {
            PersonExWithIgnoreForSelf p = CreatePersonCore <PersonExWithIgnoreForSelf>();

            p.NickName = "IgnoredForSelf boy";
            return(p);
        }
Example #2
0
        public void IgnoreForComparisonAttributeIgnoreForSelf()
        {
            //Arrange.
            PersonExWithIgnoreForSelf p1       = ModelsHelper.CreatePersonExWithIgnoreForSelf();
            PersonExWithIgnoreForSelf p2       = ModelsHelper.CreatePersonExWithIgnoreForSelf();
            ObjectComparer            comparer = ObjectComparer.Create <PersonExWithIgnoreForSelf>();

            //Act.
            var result = comparer.Compare(p1, p2, out bool _);

            //Assert.
            result.Should().NotBeNull();
            PropertyComparisonResult propertyResult = result[nameof(PersonExWithIgnoreForSelf.NickName)];

            propertyResult.Should().NotBeNull();
            propertyResult.Result.Should().Be(ComparisonResult.PropertyIgnored);
        }