public static AndConstraint <ObjectAssertions> BeLike <T>( this ObjectAssertions o, T expected, params Expression <Func <T, object> >[] skippedPropertiesOrFields) { var result = ObjectGraph.Compare(expected, (T)o.Subject, skippedPropertiesOrFields); result.ExceededDifferences.Should().BeFalse(result.DifferencesString); return(new AndConstraint <ObjectAssertions>(o)); }
public static AndConstraint <ReferenceTypeAssertions <T, TAssertions> > BeLike <T, TAssertions>( this ReferenceTypeAssertions <T, TAssertions> o, T expected, params Expression <Func <T, object> >[] skippedPropertiesOrFields) where TAssertions : ReferenceTypeAssertions <T, TAssertions> { var result = ObjectGraph.Compare(expected, o.Subject, skippedPropertiesOrFields); result.ExceededDifferences.Should().BeFalse(result.DifferencesString); return(new AndConstraint <ReferenceTypeAssertions <T, TAssertions> >(o)); }