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); }